Loading…
Count characters, words, lines, and bytes. Use for quick length checks; for full stats use word-counter. Input: text ≤10MB. Returns counts. 100% client-side.
String Length Calculator is loading — interactive editor will appear here. Use examples below to try instantly once loaded.
Press ? for keyboard shortcuts
String length calculator displaying three measurements: code points (Unicode characters), UTF-16 code units (JavaScript string length), and UTF-8 bytes (storage size). Breaks down character types into letters, digits, spaces, punctuation, and emoji with counts and percentages. Includes limit checks for SMS (160/70 GSM), Twitter (280), Instagram caption (2200), and Facebook post (63206).
String length semantics vary across contexts — JavaScript uses UTF-16, databases use UTF-8, SMS uses GSM-7. This tool surfaces all relevant measurements simultaneously and alerts users when they exceed platform limits.
This tool is part of the DevStackIO platform — a collection of free online developer tools from DevStackIO. Browse more free developer resources on DevStackIO.
Frontend developers, content creators, SMS/messaging engineers, and anyone building character-limited UIs or validating input field constraints.
Type or paste text into the input area; all measurements update in real time.
Read the three measurement lines: code points (Unicode), UTF-16 units (JS length), UTF-8 bytes.
Review the character type breakdown section showing counts and percentages for letters, digits, spaces, punctuation, and emoji.
Check the limit bars — SMS, Twitter, Instagram, Facebook — which turn red when the text exceeds the platform limit.
Hover over any emoji character to see its Unicode code point and name.
Use the clear button to reset the input and all measurements.
Input: "Hello, world! 😊" → code points: 15, UTF-16: 16 (😊 is surrogate pair), UTF-8: 19 bytes; char breakdown shows 11 letters, 1 digit, 2 punctuation, 1 space, 1 emojiInput: "a" repeated 161 times → code points/UTF-16/UTF-8 all 161; SMS limit: 160 limit exceeded (1 char over 7-bit GSM limit)Why does 😊 count as 2 in JavaScript but 1 code point? Emoji outside the Basic Multilingual Plane use surrogate pairs
2 UTF-16 code units for 1 code point.
What is the difference between code points and UTF-8 bytes? Code points are Unicode characters; UTF-8 bytes are how those characters are stored
ASCII is 1 byte, extended Latin 2 bytes, CJK 3 bytes, emoji up to 4 bytes.
How does SMS length work?
7-bit GSM characters allow 160; UCS-2 characters allow 70. If any non-GSM character is present, the entire message switches to UCS-2 (70 char limit).
Are control characters counted? Yes
tabs, newlines, and other control characters are included in all measurements and listed under the "other" category.
Authoritative specifications, standards, and in-depth reading for String Length Calculator.
Surrogate Pairs Detected (1)
ASCII Codes
Hex Bytes
Binary
Code Points
Obfuscate strings with masking and reversible transforms. Use when hiding PII in demos; for hashing use hash-generator. Input: text ≤10MB. Returns obfuscated text. 100% client-side.
Reverse text by characters (grapheme-safe for emoji), words, or lines.
Compute similarity % and Levenshtein distance between strings. Use for fuzzy match scoring; for visual diff use text-diff-visual. Input: two strings ≤10MB. Returns similarity + distance. 100% client-side.
Estimate reading and speaking time from text with adjustable words-per-minute rates. Includes word, character, sentence, and paragraph counts.
Count words, characters, and sentences. Get reading time and Flesch score as you type.
Sort lines alphabetically and remove duplicates. Use when cleaning lists; for comparing two texts use text-diff-visual. Input: text lines ≤10MB. Returns sorted unique lines. 100% client-side.
Preview rendered Markdown without editing. Use for quick read-only preview; for editing use markdown-editor, for HTML output copy use markdown-to-html. Input: Markdown ≤10MB. Returns rendered HTML preview. 100% client-side.
Generate URL slugs from titles with lowercase rules. Use as default slug tool; slugify-string is a noindex alias. Input: text ≤10MB. Returns slug string. 100% client-side.