Byte Counter: Free Online Tool
Counts
FREE TOOL · NO SIGN-UP
This byte counter shows exactly how many bytes your text takes up, so you can check it against database columns, SMS limits, API payload caps and meta tag fields that measure size in bytes rather than characters. Paste any text and you see UTF-8 bytes, the size in KB or MB, UTF-16 bytes, the character count, bits, and whether the text is pure ASCII. The counts update instantly and run entirely in your browser, so private text never leaves your device.
How to Use the Byte Counter
There is one text box and a set of live counts. Nothing to configure.
Step 1: Enter or paste your input
Paste or type your text into the box. It can be a product description, a JSON string, an SMS message, a database value, a meta description or a whole file copied from an editor. Clear empties the box when you want to test something new.
Step 2: Read the counts
The counts appear as you type:
- UTF-8 bytes (highlighted), the size most systems, web pages and databases use.
- UTF-8 size in B, KB or MB for larger text.
- UTF-16 bytes, the size in UTF-16, used inside JavaScript, Java and Windows.
- Characters, counted as real characters, so an emoji counts as one.
- Bits (UTF-8), which is bytes times eight.
- Pure ASCII? Yes if every character is basic English letters, digits and symbols.
Step 3: Apply the result
Compare the UTF-8 byte count with the limit you are working against. If you are over, trim the text and watch the count drop live. If Pure ASCII says No when you expected Yes, look for curly quotes, accented letters, emoji or invisible characters that came in with a copy and paste.
Bytes vs Characters: The Key Difference
A character is a single letter, digit, symbol or emoji as a person sees it. A byte is a unit of storage made of 8 bits. In UTF-8, a character takes between 1 and 4 bytes, so the byte count is equal to or larger than the character count.
For plain English text, the two numbers match: “hello” is 5 characters and 5 bytes. Add one accented letter, as in “café”, and you get 4 characters but 5 bytes, because é takes 2 bytes in UTF-8. Add an emoji and the gap grows again.
This matters because systems disagree about what they limit. Twitter style counters, word processors and most form fields count characters. Databases, network protocols, file systems, SMS gateways and many APIs limit bytes. A field that says “255” might mean 255 characters in one system and 255 bytes in another. Text that fits by character count can still be rejected or cut off mid-character by a byte limit. A byte counter shows you both numbers side by side.
How UTF-8, UTF-16 and ASCII Count Bytes
Each encoding stores characters differently:
| Encoding | Bytes per character | Notes |
|---|---|---|
| ASCII | 1 | Covers only 128 characters: English letters, digits, basic punctuation and control codes. |
| UTF-8 | 1 to 4 | ASCII characters use 1 byte, most European and Middle Eastern letters 2, most Asian characters 3, emoji and rare symbols 4. |
| UTF-16 | 2 or 4 | Most characters use 2 bytes; emoji and rare characters use 4 (a “surrogate pair”). |
UTF-8 is the standard for the web, HTML, JSON and most databases, which is why it is the highlighted figure. It is fully backward compatible with ASCII, so pure ASCII text has the same size in both.
UTF-16 is what JavaScript uses internally, which is why a JavaScript string’s length property can disagree with what you see on screen. The UTF-16 figure here shows the raw size without a byte order mark. English text is twice as large in UTF-16 as in UTF-8, while Chinese or Japanese text is often smaller in UTF-16.
Why Emojis and Accents Take More Bytes
UTF-8 uses variable length on purpose. The first 128 Unicode code points (ASCII) fit in a single byte. Everything beyond that needs more bytes to say which of the over one million possible code points it is.
- Accented Latin letters like é, ü and ñ, and Greek, Cyrillic, Arabic and Hebrew letters use 2 bytes.
- Chinese, Japanese and Korean characters, Indian scripts, and symbols like € and curly quotes use 3 bytes.
- Emoji and many historic or mathematical characters use 4 bytes.
Some emoji are made of several code points joined together. A family emoji, a flag or a skin tone variation can be built from 2 to 7 code points, each 3 or 4 bytes, plus invisible joiner characters. One emoji on screen can easily be 15 to 25 bytes. The Characters count here counts code points, so a combined emoji may count as more than one character too.
Hidden characters add bytes as well. Non-breaking spaces, zero-width spaces and soft hyphens copied from web pages or word processors are invisible but take 2 or 3 bytes each.
Byte Limits in Databases, SMS and APIs
Byte limits show up in more places than people expect.
- Databases. In MySQL with utf8mb4, VARCHAR limits are in characters, but index key lengths and the overall row size limit are in bytes, and each character can need up to 4 bytes. Other databases and older setups limit VARCHAR in bytes directly.
- SMS. A standard SMS holds 140 bytes. That is 160 characters in the GSM 7-bit alphabet, but if you include an emoji or a character outside that alphabet, the message switches to UCS-2 and drops to 70 characters.
- APIs and webhooks. Payload and field limits are usually set in bytes or KB. Push notifications, message queues and HTTP headers all have byte caps.
- Cookies and URLs. Browsers limit cookies to around 4 KB each, and long URLs with encoded characters grow quickly.
- File names. Many file systems cap names at 255 bytes, not characters.
When a limit is in bytes, check the UTF-8 count before you send the text.
Key Features of Our Byte Counter
- Free with no signup. Check as much text as you like.
- Six counts at once. UTF-8 bytes, size, UTF-16 bytes, characters, bits and an ASCII check.
- Accurate UTF-8. Uses the browser’s own encoder, so multibyte characters and emoji are counted correctly.
- Private. Runs in your browser; text is never uploaded.
- Instant. Counts update as you type or paste.
Who Needs Accurate Byte Counts
- Developers checking database column limits, API payloads, headers and cookies.
- SEOs and content editors testing meta fields or structured data values that a CMS stores with byte limits.
- Marketers writing SMS campaigns where one emoji changes the cost.
- Translators and localization teams who see text grow when moving from English to other languages.
- Data analysts sizing exports and CSV fields before import.
Pro Tips and Mistakes to Avoid
Checklist of best practices
- Test real content, including names, addresses and emoji users might type, not just English sample text.
- Leave a safety margin under byte limits, since one extra emoji can add 4 or more bytes.
- Use utf8mb4 in MySQL if you need to store emoji.
- Check Pure ASCII before sending text to old systems that only accept ASCII.
Common mistakes and quick fixes
- Assuming 1 character = 1 byte. True only for ASCII. Check the UTF-8 count.
- Using JavaScript length as a byte count. It counts UTF-16 code units. Use the UTF-8 figure for storage and network limits.
- Hidden characters from copy and paste. If bytes look high, clean the text with the Extra Spaces Remover or retype it.
- Cutting text mid-character. Trimming by bytes can break a multibyte character. Trim by characters, then recheck bytes.
Measure Text Size Before It Breaks
Paste your text above to see its exact byte size in UTF-8 and UTF-16. Count visible characters with the Character Counter, check words with the Word Counter, and test meta tags with the Meta Length Checker. Browse all free tools in the FHSEO Hub tools directory.
