ANSI Escape Code Preview
Paste ANSI escape code text and see it rendered with terminal colors and styles.
About This Tool
The ANSI Escape Code Preview tool renders ANSI-escaped text with full color and style support directly in your browser. Paste text containing ANSI escape sequences and see the rendered output with foreground colors, background colors, bold, italic, underline, dim, and strikethrough styles.
ANSI escape codes are special character sequences used by terminal emulators to control text formatting. They start with an escape character (ESC, \x1b, \033, or \e) followed by a bracket and formatting codes. These codes are ubiquitous in CLI tools, build output, log files, and shell scripts.
The tool supports all standard ANSI formatting: 4-bit colors (16 standard and bright colors), 8-bit (256-color) mode via \e[38;5;Nm, and 24-bit true color via \e[38;2;R;G;Bm. It also handles text styles including bold (1), dim (2), italic (3), underline (4), and strikethrough (9), along with their reset codes.
All processing runs entirely in your browser. No data leaves your machine. For a reference table of all ANSI color codes, see our ANSI Color Code Reference. For other text transformation tools, try our ASCII Art Generator or our HTML Live Preview.
The input accepts three common escape sequence formats: \e[, \033[, and \x1b[. The tool automatically converts these textual representations into actual escape sequences for rendering.
How to Use
- Paste or type ANSI-escaped text into the Input textarea on the left.
- Use escape formats like
\e[31m(red),\e[1;32m(bold green), or\e[0m(reset). - The Rendered Preview on the right shows the text with applied colors and styles.
- Click Copy Plain Text to copy the output without ANSI codes.
- Click Load Example to see a pre-filled demonstration.
- Expand the Quick Reference section for a list of common ANSI codes.
- Click Clear to reset the tool.
Popular ANSI Escape Code Examples
FAQ
Is my data safe when using this tool?
Yes. All parsing and rendering happens entirely in your browser using client-side JavaScript. No text is sent to any server, and nothing is stored or logged.
What escape sequence formats are supported?
The tool supports three common textual representations: \e[ (used in echo -e and many tutorials), \033[ (octal escape), and \x1b[ (hex escape). All three are converted to actual ANSI escape sequences before rendering.
Does this support 256-color and true color?
Yes. The tool supports 4-bit colors (codes 30-37, 40-47, 90-97, 100-107), 8-bit 256-color mode (38;5;N for foreground, 48;5;N for background), and 24-bit true color (38;2;R;G;B for foreground, 48;2;R;G;B for background).
Can I paste output directly from my terminal?
If your terminal output contains actual ANSI escape bytes (not the textual \e[ notation), the tool may not render them directly since browsers strip control characters from paste events. For best results, use the textual notation (\e[, \033[, or \x1b[) in the input.
Which text styles are supported?
The tool supports bold (1), dim (2), italic (3), underline (4), and strikethrough (9). Each can be combined with colors. The reset code (0) clears all formatting.
How do I combine multiple styles?
Separate multiple codes with semicolons within a single escape sequence. For example, \e[1;4;31m applies bold, underline, and red color simultaneously. Use \e[0m to reset all styles.
Related Tools
ANSI Color Code Reference
Complete ANSI escape code reference with 256-color palette, true color, text formatting, and copy-ready sequences for Bash, Python, Node.js, Go, and C.
ASCII Art Generator
Convert text to ASCII art using various font styles. Choose from multiple fonts, adjust width, and copy the result.
HTML Live Preview
Write HTML, CSS, and JavaScript with instant live preview in a sandboxed iframe. No setup required.
Text Case Converter
Convert text between camelCase, PascalCase, snake_case, kebab-case, and other naming conventions.
Color Converter
Convert colors between HEX, RGB, HSL formats with contrast checker and palette generator.