100% Browser-LocalZero File UploadsVerify privacy →

Byte & Character Counter

Measure exact byte lengths in UTF-8, UTF-16, GBK, Big5, and Shift_JIS alongside Unicode grapheme clusters, code points, words, lines, and database/SEO limits.

Byte & Character Counter

UTF-8
1919 B
UTF-16
2613 code units
GBK
N/A14B ('?'×1)
Shift_JIS / Big5
N/A / N/A14/14B
Visual Characters
1212 code points
Words / Lines
5 / 110 non-space
Samples:

Why Byte Length Differs from Character Count

In UTF-8, ASCII characters take 1 byte, European accented characters take 2 bytes, Chinese/Japanese/Korean characters take 3 bytes, and Emoji take 4 bytes (or more for ZWJ sequences). Legacy encodings like GBK, Big5, and Shift_JIS use 2 bytes for most CJK characters. Checking exact byte size prevents database truncation and API limit errors.

5 Encodings Compared Live

Measure UTF-8, UTF-16, GBK, Big5, and Shift_JIS byte sizes simultaneously as you type or paste.

True Grapheme Cluster Counting

Uses Intl.Segmenter so composite Emoji (👨‍👩‍👧‍👦) and accented sequences count as 1 user-perceived character.

UTF-8 Byte-Width Breakdown

Separates 1-byte ASCII, 2-byte Latin/Cyrillic, 3-byte CJK, and 4-byte Emoji characters at a glance.

Database, URL & SEO Thresholds

Flags overflows against MySQL VARCHAR(255), 255-byte payloads, 60-char titles, 160-char meta descriptions, and 2,048-byte URLs.

How to Measure Exact String Byte Size

  1. Paste or type your text — Enter SQL values, API JSON fields, CSV cells, multilingual headlines, or Emoji strings into the editor.
  2. Compare encoding byte totals — Read instant UTF-8, UTF-16, GBK, Big5, and Shift_JIS counts in the top metric cards.
  3. Inspect UTF-8 width distribution — See which characters cost 3 or 4 bytes and explain why byte size exceeds visual character count.
  4. Verify database and SEO caps — Check the threshold panel to confirm your text fits within MySQL, URL, or search snippet limits.

Byte Cost Comparison Across Encodings

The same visible character consumes very different storage depending on character encoding:

Example CharacterUTF-8UTF-16GBK / Big5Shift_JIS
A (Basic ASCII)1 B2 B1 B1 B
é / ü (Accented Latin)2 B2 B2 BN/A
中 / あ (Chinese / Japanese)3 B2 B2 B2 B
🚀 (Single Emoji)4 B4 BN/AN/A
👨‍👩‍👧‍👦 (Family ZWJ Emoji)25 B22 BN/AN/A

When Exact Byte Counting Matters

Database Schema & Index Sizing

Avoid MySQL InnoDB 767/3072-byte index key errors and Oracle VARCHAR2(n BYTE) truncation on multilingual columns.

HTTP Headers, Cookies & URLs

Ensure browser cookies stay under 4,096 bytes and encoded query URLs remain well below proxy and CDN limits.

Legacy Enterprise GBK / Shift_JIS Files

Validate fixed-width mainframe, banking, and Japanese/Chinese ERP import records before batch submission.

SEO Metadata & Social Copy QA

Measure visual character lengths cleanly alongside UTF-8 byte footprint for title tags and meta descriptions.

Fallback bytes and line breaks: characters outside legacy character sets (such as Emoji in GBK or Shift_JIS) are counted as a 1-byte "?" fallback. Browser textareas store newlines as LF (1 byte), while Windows CRLF files use 2 bytes per line break.

Frequently Asked Questions

Why does a single Emoji take 4 or more bytes in UTF-8?

Emoji sit above U+FFFF so each base code point requires 4 UTF-8 bytes, and composite Emoji (like 👨‍👩‍👧‍👦) combine multiple code points plus ZWJ joiners (25 bytes total) while rendering as 1 grapheme cluster.

Why is GBK or Shift_JIS byte length smaller than UTF-8 for CJK text?

Common Chinese and Japanese characters occupy 2 bytes in GBK/Big5/Shift_JIS, whereas UTF-8 encodes most CJK Unified Ideographs in 3 bytes.

What is the difference between visual characters (graphemes) and JS .length?

JavaScript .length counts UTF-16 code units (so 🚀 has .length === 2). Intl.Segmenter grapheme counting reports the true number of user-perceived characters.

Does MySQL VARCHAR(255) limit characters or bytes?

In modern MySQL utf8mb4, VARCHAR(255) limits 255 Unicode code points, which can consume up to 255 × 4 = 1,020 bytes of storage.

Do newlines count toward byte size?

Yes. Each Unix newline (\n) adds 1 byte in UTF-8 and 2 bytes in UTF-16; Windows CRLF (\r\n) adds 2 bytes in UTF-8.

Why does a single emoji or Chinese character cut SMS length from 160 to 70 characters?

Standard ASCII and basic European characters fit inside 7-bit GSM-7 encoding, allowing 160 characters per SMS segment (153 per part when concatenated). Adding even one CJK character, curly quote, or emoji forces carriers to switch the entire message to 16-bit UCS-2/UTF-16 encoding, dropping the single-SMS cap to 70 UTF-16 code units (67 per concatenated part).