shxtrk

bits

Text down to its code points and UTF-8 bytes, and bytes back to text.

Read the box as

examples

characters
6
code points
8
UTF-16 units
10
UTF-8 bytes
15
which one your language counts
unitherecounted by
charactersSwift count
code pointsPython len(), JavaScript [...s].length, char_length() and varchar(n) in Postgres and MySQL
UTF-16 unitsJavaScript length, Java length(), C# Length, HTML maxlength
UTF-8 bytesGo len(), Rust len(), octet_length(), HTTP Content-Length
copy as · · · · ·

Each column is one character as a reader would count it. Under it are its code points, and under those the bytes UTF-8 writes, so every column is as wide as the bytes it takes. A line marks each place where one thing is made of several of the next.

The four counts agree only while the text stays in ASCII, and even there CR LF is one character made of two code points. A limit set in one count can land inside another: cut the default text after 12 bytes and only the first of the skin tone's four bytes is left, which a decoder turns into U+FFFD.

In bytes mode the box takes hex, and a byte that breaks UTF-8's rules gets its own column with the rule it broke. A text box stores every line break as LF, so a CR only shows up in hex or in a file. Files are read here and never uploaded.

The character count and the panel's categories and scripts come from the browser, so they follow its version of Unicode. A browser whose Unicode is older than 15.1 counts a Devanagari conjunct such as क्ष as two characters, and a newer one counts it as one. Names are built in for ASCII, Latin-1, the basic Greek and Cyrillic letters, the Combining Diacritical Marks and General Punctuation blocks, and the common invisible characters. Where Unicode builds a name from a pattern, as it does for Hangul syllables, the page works it out; anything else shows only its category and script.