Syntax Highlighter
This syntax highlighter colors source code without installing anything: paste your code, choose the language and a light or dark color scheme and copy the finished HTML. The colors are built into the markup, so the code displays correctly in blogs, emails and documents without an extra stylesheet.
Source: WCAG 2.2 – Success Criterion 1.4.3 Contrast (Minimum): 4.5:1 for text (colors of both themes checked). Updated: .
How it is calculated
Syntax highlighting colors the building blocks of source code: keywords, strings, numbers, comments and function names each get their own color. This makes code easier to read, especially in texts, documentation and emails, where there is no editor with a color scheme.
What the highlighter can do
- Seven languages: JavaScript and TypeScript, JSON, HTML (with embedded script and style), CSS, SQL, Python and Bash. With “Detect automatically” the tool picks the language from the text.
- Two color schemes: light on white and dark on a dark background. Every text color reaches the 4.5 to 1 contrast ratio of accessibility guidelines.
- Two output forms: with colors inside the markup the result works everywhere; with CSS classes it is shorter and can be recolored through your own stylesheet.
- Line numbers: on request each line is preceded by its number, which cannot be selected along with the code.
Safe and lossless
The source code is not changed, only split into sections and wrapped with color information. Characters such as < and & are escaped so that code containing HTML fragments cannot affect the rest of the page. To tidy code beforehand, use the JSON formatter, the SQL formatter or the HTML formatter.
Frequently asked questions
How do I color code for a blog post?
Paste the code, choose language and color scheme and copy the HTML from the result field. Insert it into the blog editor as an HTML block. The colors are in the markup, so no extra stylesheet is needed.
Can I paste the colored code into Word or an email?
Yes, usually via the preview: select, copy and paste, and the colors are kept. In programs that do not accept HTML, a screenshot of the preview helps.
Which languages are supported?
JavaScript and TypeScript, JSON, HTML with embedded script and style, CSS, SQL, Python and Bash. For any other language choose “Plain text”; then only the block formatting remains.
Is my code stored or sent anywhere?
No. Processing happens in your browser. The code is not in the address bar and is not stored.
Why are some parts not colored?
The highlighter recognizes patterns such as keywords, strings and comments but is not a full parser. Unusual syntax or language variants therefore occasionally stay black.
Sources and legal basis
- WCAG 2.2 – Success Criterion 1.4.3 Contrast (Minimum): 4.5:1 for text (colors of both themes checked)
- WHATWG HTML – Syntax: character references and escaping of &, < and > in text
- ECMAScript Language Specification – reserved words and lexical grammar (basis of the JavaScript highlighting)
As of: · Editorial policy
Related tools
- JSON formatter, validator and minifierValidate JSON against RFC 8259 with the exact line, column and a plain-English explanation. Beautify or minify, sort keys, copy. Runs locally in your browser.
- SQL formatter (format SQL online)SQL formatter for readable queries: uppercase keywords, indentation, columns and conditions on separate lines. Also minifies SQL. Runs locally in your browser.
- HTML formatterHTML formatter: indent source code to make it readable, or minify it to a single line, with warnings about unclosed tags. Runs locally in your browser.
- Regex TesterTest JavaScript regular expressions live: matches highlighted, capture groups in a table, every part of the pattern explained. Free, nothing uploaded.
- What is my IP address?What is my IP? See your public IPv4 or IPv6 address at once, plus approximate location, internet provider and browser details. Free, never stored.
- IEEE 754 converterIEEE 754 converter for half, single and double: convert decimal, hex or bits, and see sign, exponent, mantissa and the exact stored value with rounding error.
- CSS gradient generatorBuild CSS gradients: linear, radial or conic, as many color stops as you need, angle and fallback color – live preview and CSS ready to copy.
- Validate Email Address SyntaxCheck one or many email addresses for correct syntax under RFC 5321/5322: lengths, domain labels, international domains (Punycode). Local, nothing sent.
- JSON to TypeScript converterConvert JSON to TypeScript: generate types, interfaces or JSON Schema from sample data, with optional fields. Runs in your browser, no upload.