HomeToolsEncodingASCII Converter

ASCII Converter

Convert text characters to ASCII code values in decimal, hex, binary, and octal.

Encoding
Input Text
Output decimal Codes

Start with the character, then choose the notation

ASCII assigns numeric codes to 128 characters: controls from 0 through 31, printable characters from 32 through 126, and DEL at 127. The letter A is decimal 65, hexadecimal 41, binary 01000001, and octal 101. Those are not four encodings of different data; they are four numeral-system spellings of the same character code.

This ASCII converter moves in both directions. Text to Codes produces a space-separated sequence in decimal, hex, binary, or octal. Codes to Text parses space-separated values in the selected base and creates JavaScript characters. The conversion updates immediately, and the result can be cleared or copied.

The historical ASCII range is 0-127, but the implementation accepts JavaScript UTF-16 code units through 65535 in decode mode and can emit values above 127 in encode mode. It is therefore useful as a character-code converter while requiring care when strict ASCII is the protocol requirement.

Four views of a command string

Enter AT in text mode. Decimal output is 65 84; hex is 41 54; binary is 01000001 01010100; octal is 101 124. Change the format selector to compare representations without changing the text.

This pattern is common in embedded and serial documentation. A modem command might be described as ASCII text ending with carriage return. AT plus CR has decimal codes 65 84 13, or hex 41 54 0D. The converter can decode those numeric values, although the carriage return is invisible in the output area.

Output values use fixed minimum widths for readability: two hex digits, eight binary digits, and three octal digits. Decimal has no padding. Values above those minimums expand rather than being truncated.

Going from codes back to text

Switch to Codes to Text, choose the base, and separate every code with whitespace. For hexadecimal:

48 65 6C 6C 6F

produces Hello. Hex prefixes are unnecessary; enter 48, not 0x48. Binary input should look like 01001000 01101001, and octal like 110 151. Newlines and multiple spaces are valid separators because parsing splits on whitespace.

Commas, semicolons, and hyphens are not separators. A value such as 65,66 is passed as one token; JavaScript’s permissive integer parsing may consume the valid prefix and ignore the rest rather than rejecting the entire token. Use clean space-separated tokens and verify the result. An explicit error appears only when a parsed token is not a number or falls outside 0-65535.

Strict ASCII versus extended character codes

If you are validating an ASCII-only field, accept only codes 0 through 127. Values 128-255 have different meanings in Windows-1252, ISO-8859-1, and other legacy code pages; there is no single “extended ASCII” standard. The converter does not let you select a code page. It interprets a number as a JavaScript UTF-16 code unit.

For example, decimal 233 becomes é because U+00E9 occupies that UTF-16 code unit. That does not mean byte E9 represents é in UTF-8. UTF-8 encodes that character as two bytes, C3 A9. When inspecting bytes from a file or network capture, identify the actual character encoding before using a code-to-text result.

Unicode characters in text mode

Text mode iterates visible Unicode code points with Array.from, then calls charCodeAt(0) for each. Basic Multilingual Plane characters usually produce their UTF-16 value. A supplementary character such as many emoji is represented internally by a surrogate pair; only the first surrogate code unit is emitted for that iterated character. Consequently this ASCII converter is not suitable for translating arbitrary emoji or supplementary scripts to complete Unicode values.

Use the Unicode converter for code-point escape notation, or TextEncoder for UTF-8 bytes. Reserve this page for ASCII, BMP code units, and simple base conversion.

Inspecting a network header

Suppose a packet analyzer shows bytes 47 45 54 20 and the protocol says the field is ASCII. Select code-to-text and hexadecimal, paste the sequence, and obtain GET , including its trailing space. Continue only through bytes known to be text; arbitrary payload bytes may become controls or misleading glyphs.

For a request terminator, hex 0D 0A creates carriage return and line feed. The output may look like an empty line. Keep the source sequence alongside the decoded view so invisible structure is not lost. For reproducible analysis, use a hex editor or packet tool that displays offsets and ASCII simultaneously; this converter is a focused scratchpad.

Control codes need names, not just glyphs

ASCII controls include NUL (0), horizontal tab (9), line feed (10), carriage return (13), and escape (27). Browsers do not render these as labels. They may create whitespace or remain invisible in the output textarea. DEL (127) likewise has no printable glyph.

When building a device command, record controls symbolically in documentation and verify their numeric codes. Copying output text containing controls can cause terminal behavior, newline normalization, or editor transformations. If exact bytes matter, construct a byte array in code instead of copying rendered text.

Input range and surprising parses

Code-to-text mode rejects negative values and values above 65535. It does not enforce the selected format’s digit alphabet as strictly as a dedicated lexer. Binary token 102 may parse its valid leading portion, and decimal 65abc may be read as 65. Prefixes can also interact unexpectedly with an explicitly supplied radix. Clean input is essential.

An empty or whitespace-only input clears output and errors. Switching modes replaces the input with a new sample, so save work before toggling. Changing bases does not convert the numeric tokens themselves; it reinterprets them. The token 10 means decimal 10, hex 16, binary 2, or octal 8 depending on the selected format.

Common production uses

Embedded developers can translate command characters into constants for firmware. Protocol engineers can identify printable segments in byte dumps. Teachers can demonstrate positional notation. Developers maintaining legacy fixed-width records can confirm separators and terminators. Test authors can create assertions for known ASCII payloads.

Do not use the tool as a code-page transcoder, binary file reader, UTF-8 validator, or security sanitizer. A readable conversion says nothing about whether text is safe for HTML, SQL, shell commands, or logs. Escaping and validation belong to the destination context.

Line-ending analysis is a useful exception to ordinary visible-text work. Unix text commonly ends lines with LF (10, hex 0A), while many Windows files use CR followed by LF (13 10, hex 0D 0A). Classic systems may use CR alone. Converting these codes explains apparently blank differences without changing the file prematurely.

Troubleshooting guide

If code input fails, ensure values are separated by spaces or newlines and contain only digits valid for the selected base. If output changes after selecting another base, the same tokens are being reinterpreted. If a result is blank, check for control values. If non-English text yields unexpected numbers, distinguish Unicode code points, UTF-16 code units, and UTF-8 bytes.

If hex copied from a dump contains offsets, colons, or an ASCII gutter, remove them first. If a value above 127 differs from legacy software, determine that software’s code page. If an emoji yields one surrogate value, use a code-point-aware Unicode tool.

ASCII converter FAQ

Can it convert ASCII to binary?

Yes. Choose Text to Codes and Binary. Standard ASCII characters produce eight-bit-padded groups.

Can it convert binary to ASCII text?

Yes. Choose Codes to Text and Binary, then enter whitespace-separated values. Keep each character code as a separate token.

Does it support commas between numbers?

No reliable comma tokenizer is provided. Use spaces or newlines to avoid permissive partial parsing.

Why does decimal 10 not display a character?

Code 10 is line feed, a control that creates a newline rather than a visible glyph.

Is every value up to 255 ASCII?

No. ASCII ends at 127. Values above it depend on another encoding or Unicode interpretation.

Does it produce UTF-8 bytes?

No. It works with JavaScript character/code-unit values. Use a UTF-8 encoder when byte-accurate output is required.

Learn More

Read our comprehensive guide to master this utility.

Read Guide →