Developer Tools
ANSI to HTML Converter
Convert terminal output with ANSI color codes into HTML. 16-color, 256-color, and truecolor, with inline styles or CSS classes. Free, runs in your browser.
HTML style
Every span carries its own style attribute. Best for pasting a single block where you cannot add a stylesheet, such as an email or a CMS field.
Output wrapper
Off emits just a styled <pre> block (plus a <style> in class mode) to drop into an existing page. On produces a complete, standalone .html file you can open directly.
Real escape bytes work, and so do the \x1b, \033, \u001b, \e, and ^[ text forms.
Live preview
Rendered from the parsed colors, the same result as your HTML.✓ build completed in 1.84s [12:04:11] INFO server listening on http://localhost:3000 [12:04:12] WARN deprecated option --legacy will be removed [12:04:13] ERROR failed to connect to database ● 256-color orange ● truecolor purple reverse video strikethrough bold underline magenta
Summary
Escape codes
36
Lines
6
Styled spans
17
HTML bytes
1,203
Supported: 16-color and bright palettes, the xterm 256-color palette (38;5;N and 48;5;N), 24-bit truecolor (38;2;R;G;B and 48;2;R;G;B), plus bold, dim, italic, underline, reverse video, and strikethrough. Cursor-movement and screen-clear sequences are removed so they do not show up as stray characters.
How to use
- Paste your colored terminal or log output into the input box. Real escape bytes work, and so do the \x1b, \033, \u001b, \e, and ^[ text forms.
- Choose an HTML style: Inline styles for a single self-contained block, or CSS classes for a compact stylesheet plus class names.
- Optionally turn on Wrap in a full HTML document to get a complete standalone .html file instead of just a pre block.
- Check the live preview to confirm the colors and styles match what you expected.
- Press Copy HTML to copy the generated markup, then paste it into your page, README, or docs. Use Load sample to see a worked example or Clear input to start over.
About this tool
ANSI to HTML Converter takes raw terminal output that contains ANSI escape codes, the ESC[ ... m sequences that color text in bash, zsh, fish, PowerShell, npm, yarn, pnpm, cargo, go, pip, pytest, git, docker, kubectl, and almost every modern CLI, and turns it into clean HTML you can paste into a blog post, documentation, a README rendered on GitHub Pages, a static site, or a changelog. Paste a captured log and the parser walks the Select Graphic Rendition (SGR) parameters of ECMA-48 and reproduces them faithfully: the standard 16-color palette (30 to 37 and 40 to 47), the bright variants (90 to 97 and 100 to 107), the xterm 256-color palette via 38;5;N and 48;5;N (the 6x6x6 RGB cube and the grayscale ramp included), and 24-bit truecolor via 38;2;R;G;B and 48;2;R;G;B, alongside bold, dim, italic, underline, reverse video, conceal, and strikethrough. It understands the textual forms of the escape byte that people paste from a string they captured, including \x1b, \033, \u001b, \e, and the caret notation ^[, and normalizes them all before parsing, so you do not have to convert anything first. Non-SGR control sequences such as cursor movement and clear-screen, plus the carriage-return line rewrites that progress bars emit, are recognized and removed so they do not show up as stray characters in your HTML. Two output styles are available. Inline styles put a style attribute on each colored span and wrap the result in a styled pre block, which is ideal when you cannot add a stylesheet, such as an email or a locked-down CMS field. CSS classes give every span a semantic class name and emit a compact stylesheet that lists only the colors you actually used, which keeps the markup readable and is the better choice for blogs and docs. You can copy just the pre block to drop into an existing page, or toggle the full document option to get a complete standalone .html file you can open directly. A live preview renders the same colors the HTML will produce so you can confirm the result before copying, and a summary counts the escape codes, lines, styled spans, and output size. Parsing, rendering, and HTML generation all run locally in your browser, so the log you paste, which may include private paths, hostnames, or tokens, is never uploaded or stored.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
ANSI Color Code Generator
Compose terminal color escape sequences with a live preview and copy-ready snippets.
Open tool
DeveloperHTML Formatter
Pretty-print and minify HTML with indent, wrap, and quote controls.
Open tool
DeveloperStack Trace Beautifier
Parse, classify, and clean stack traces across nine common runtimes.
Open tool
DeveloperLogfmt Parser and Formatter
Parse logfmt to JSON or NDJSON and emit clean logfmt from JSON, NDJSON, or rows.
Open tool
DeveloperHTML Entity Encoder Decoder
Two-way HTML entity encoder and decoder with named, decimal, and hex modes.
Open tool
ConverterColor Format Converter
Convert any CSS color to HEX, RGB, HSL, HWB, CMYK, and named values at once.
Open tool