Byte & Character Counter

Words, Lines, UTF-8

Count UTF-8 bytes, characters, words, lines, and sentences instantly. Free online byte counter and string size tool.

Counts run locally in your browser — nothing is uploaded.

Characters

0

Words

0

Lines

0

Bytes (UTF-8)

0

  • Characters (no spaces)0
  • Sentences0

Set your form or API limit. Spaces, line breaks and emoji count toward UTF-8 bytes.

Input

What is this tool?

This string counter measures text length from several practical angles: characters, characters without whitespace, words, lines, sentences, and UTF-8 bytes. Counts update live as you type; nothing is uploaded.

Different limits count different things. A UI field may cap characters, a database column may cap bytes, an editorial brief may cap words, and an API may care about encoded payload size. Non-ASCII characters can use multiple UTF-8 bytes even when they look like one glyph.

Common use cases

  • Check meta descriptions, social posts, or form fields against character vs byte limits
  • Compare translation length before shipping UI copy
  • Measure API or log payload size in UTF-8 bytes before sending

How to use

  1. Paste or type text into the input. KPIs (characters, words, lines, UTF-8 bytes) update live at the top.
  2. Use characters without spaces and sentences in the chip row for finer checks.
  3. Load Sample to see ASCII vs Hangul/emoji byte differences.
  4. Copy the stats summary or Clear when done.

Examples

Input / settingOutputNotes
Hello world.chars 12 · no-spaces 11 · words 2 · lines 1 · sentences 1 · UTF-8 12Simple ASCII.
안녕하세요chars 5 · words 1 · UTF-8 15Hangul: 3 bytes per syllable in UTF-8.
Hi 👋chars 5 · words 2 · UTF-8 7Space + waving hand: JS length 5 (👋 = 2 UTF-16 units), UTF-8 7.
One.\nTwo!lines 2 · sentences 2 · words 2Newline starts a new line; ! ends a sentence.

Check a UTF-8 byte limit

Enter your form or API limit above. With a 10-byte limit, 안녕😀 uses 10 bytes and leaves 0; adding one space uses 11 and exceeds the limit by 1. The copy summary includes the limit and remaining or excess bytes.

Only raw text is measured, not JSON quotes, escaping, HTTP headers or file metadata. Textareas normalize line endings to LF; a server that stores CRLF adds another byte per line break. Match the server encoding: UTF-8 counts are not EUC-KR counts.

Practical pitfalls

  • UTF-8 bytes ≠ characters: Hangul, CJK, and emoji inflate byte size; do not use string.length alone for storage quotas.
  • Words are whitespace-based: CJK or glued tokens without spaces usually count as one word—not a linguistic tokenizer.
  • Character count is JavaScript UTF-16 length: some emoji are two “characters” even though they render as one glyph.
  • Sentence detection is punctuation-heuristic; U.S.A.-style abbreviations can over-count.

Continue the workflow

If a log contains literal Unicode escapes, decode the Unicode text before measuring the readable string. The characters in an escape sequence and its decoded value have different sizes. For model input limits, use the LLM token calculator: bytes and tokens are different units.

References

Last reviewed: 2026-10-11

Frequently asked questions

Why do UTF-8 bytes differ from character count?
Character count uses JavaScript string length (UTF-16 code units). UTF-8 byte size is what TextEncoder produces. Non-ASCII text (Hangul, emoji, accents) often needs more than one byte per visible character—and some emoji use two UTF-16 units but four UTF-8 bytes.
How are words counted?
After trimming, the text is split on whitespace (spaces, tabs, newlines). Consecutive spaces still count as one break. Text without spaces—such as many CJK phrases—counts as one word.
Are sentences counted accurately for every language?
Sentences are heuristic: runs ending with `.`, `!`, or `?`. Abbreviations (e.g. `Dr.`) and scripts that do not use those marks can skew the count.
Is text uploaded?
No. All counts run locally in your browser.
Does the byte limit include JSON or request overhead?
No. It compares your chosen limit with the raw text encoded as UTF-8. JSON quotes, escaping and HTTP headers are not included. Textarea line endings use LF; a server using CRLF can store more bytes.