Skip to main content
ASCII Art Generator

ASCII, ANSI, Unicode and UTF-8

A line can be Unicode text, stored as UTF-8 and decorated with terminal escape sequences at the same time. Calling all of that ANSI hides the question you need to answer: which characters, which bytes, or which terminal commands?

Compare exact code points and bytes

Separate the character from its storage

ASCII
A 7-bit character code with 128 values, 0–127. Printable characters occupy 0x20–0x7E; the rest include controls and DEL. A, +, - and | are ASCII. A full block █ and an accented é are not. RFC 20 describes storing 7-bit ASCII in an eight-bit byte with its top bit zero.
Unicode code points
Numbers written like U+0041 for A and U+2588 for FULL BLOCK. Unicode's code space extends through U+10FFFF. Scalar values exclude the surrogate range U+D800–U+DFFF. A code point is not a font shape, a UTF-8 byte count or necessarily one user-perceived character.
UTF-8
An encoding of Unicode scalar values into one to four bytes. ASCII uses the same values 00–7F in UTF-8, so an ASCII byte string is also valid UTF-8. Other characters often need several bytes. Changing the font does not change those bytes.

The phrase extended ASCII does not name one encoding. For bytes above 7F, ask for a specific code page or encoding. A file extension such as .txt or .ans does not establish it.

Four characters, four exact byte sequences

These original tiny specimens use the current inspector and hex/binary encoders. Each row is one code point. The hex and binary columns describe UTF-8 bytes, not alternative code-point numbers.

Actual inspected characters and current UTF-8 encoder outputs
TextCode pointInspector escapesUTF-8 hexUTF-8 binaryBytes
AU+0041A41010000011
éU+00E9\u{00E9}C3 A911000011 101010012
─U+2500\u{2500}E2 94 8011100010 10010100 100000003
█U+2588\u{2588}E2 96 8811100010 10010110 100010003

Try E2 94 80 in Hex to decode: it gives ─ (U+2500). Pasting 2500 instead supplies bytes 25 00, not that Unicode character; this decoder rejects the NUL control. For A, the seven ASCII bits are 1000001, while the stored eight-bit byte is 01000001. The binary translator expects complete eight-bit groups in plain binary mode.

The letter é can also be written as e plus U+0301. That sequence has two code points and UTF-8 bytes 65 CC 81, even though it can look like the one-code-point spelling above. The inspector reports scalar order and UTF-16 offsets; it does not measure the width of the shaped letter.

ANSI has two common, different meanings

Terminal escape sequences control presentation

What people call ANSI colors or ANSI escapes usually means terminal control sequences for things such as color and cursor movement. Those commands are separate from the encoding of the surrounding text. A terminal must support and enable the relevant behavior; a plain text field may show or ignore it instead.

This illustrative red-text sequence is displayed as escape notation only. The backslash and braces below are explanatory characters, not a command to paste into a terminal:

\u{001B}[31mOK\u{001B}[0m
Corresponding bytes: 1B 5B 33 31 6D 4F 4B 1B 5B 30 6D

ESC is U+001B, byte 1B. ESC followed by [ introduces this control sequence; 31m selects red foreground in Microsoft's documented terminal SGR behavior, and 0m resets graphic rendition. Exact color shades depend on the terminal palette. The literal letters O and K are still ASCII.

Do not run untrusted art or log contents as terminal output to inspect them. Controls can affect the display. The Unicode inspector reveals ESC as an escape token and CONTROL row without executing it. Hex to text and the binary translator reject ESC and other disallowed controls; they are not ANSI-art viewers. ASCII to PNG also rejects ANSI controls and does not reproduce terminal colors.

Windows ANSI labels refer to code pages

A legacy Windows Save as ANSI option refers to a Windows code page, not terminal color instructions and not one universal encoding. Microsoft describes Windows code pages such as 1252 separately from OEM code pages such as 437. Ask which encoding was used; do not infer it from the label ANSI alone.

CP437 art needs its original decoding rules

CP437 is a legacy DOS/OEM code page with box-drawing, shade and block characters above the ASCII range. In Microsoft's public mapping, byte C4 maps to ─ (U+2500) and byte DB maps to █ (U+2588). In UTF-8, those same characters need E2 94 80 and E2 96 88. A lone C4 or DB is not a complete UTF-8 sequence.

Illustrative text: ─█
CP437 bytes: C4 DB
Unicode code points: U+2500 U+2588
UTF-8 bytes: E2 94 80 E2 96 88

Preserve the original file. If it is known to be CP437, use a local editor or decoder with an explicit CP437 option, then save a separate UTF-8 copy. That is an external preparation step, not a conversion this site offers. Never overwrite the only original while guessing an encoding.

The inspector's file loader is strict UTF-8, limited to 3,000 bytes and 1,000 UTF-16 units. It does not import arbitrary .ans files, decode CP437 or replay terminal cursor commands. A UTF-8 copy that still contains escapes can be inspected as characters, but it is not a faithful reconstruction of the terminal screen. A box rendered in a modern font also need not match a historical cell font's geometry.

Choose a tool for the question you have

For unexpected blanks, inspect code points first. For known UTF-8 byte strings, use the hex or binary translator. For a new fixed-width screen sketch, the terminal mockup builder provides ASCII and Unicode border choices; it makes plain text, not a running terminal application or an ANSI player.

For a receiving app, confirm both its text encoding and its rendering rules. UTF-8 alone does not guarantee aligned cells, font coverage or preserved whitespace. Move private input by local copy or file, not a query-string link; export a backup before leaving a tool.