piapia123
en

Code Highlighter (26 languages)

Web

Everything runs locally in your browser — nothing is uploaded

Input
Drop a file here to load its contents
Output

Colourise a block of code so it survives being pasted somewhere else. There are two routes. In preview mode the page shows the highlighted block directly; select it and copy, and the browser puts the DOM and its styles on the clipboard — the colours stay when you paste into slides, Word or email, which is the least-effort path and needs no special steps. HTML mode emits a snippet with inline styles that drops straight into a blog, static site or email template. Inline styles rather than classes, because the destination has no stylesheet of ours: `class="hljs-keyword"` is just uncoloured text over there. The palette matches the site's own code blocks, in light and dark.

Features

  • 26 languages: JavaScript, TypeScript, Python, Go, Rust, Java, C++, C#, PHP, Ruby, SQL, YAML, JSON, XML and more
  • Preview mode: select and copy with the colours, straight into slides or Word
  • HTML mode: inline-styled HTML that keeps its colours anywhere
  • Light and dark palettes matching the site's code blocks
  • Nothing to click — code is highlighted as you type
  • Past 20,000 characters it falls back to plain text rather than freezing the page

How to use

  1. Paste code and pick a language
  2. Preview mode shows the highlighted result immediately
  3. Select and copy for slides; switch to HTML mode for a page or email
  4. HTML mode offers a light or dark palette

FAQ

How do I paste coloured code into slides?
In preview mode, select the highlighted block with the mouse and press Ctrl+C (⌘+C on a Mac), then paste directly into your slides — the browser writes the DOM and its styles to the clipboard, so the colours survive. Do not use the "copy all" button for this: that takes the plain text, which pastes without colour.
Why inline styles in HTML mode?
Because the destination has none of this site's CSS. Output like `class="hljs-keyword"` would be uncoloured text in your blog — a highlighter's class names only mean something when the matching stylesheet is present. Inline styles put the colour on each tag, so they work anywhere.
How many languages are supported?
Twenty-six, covering the main languages and config formats in day-to-day work. That list has been pruned by size: every grammar registered adds to the page's download. So the cost is measured before a language is added (the method is written down in the README).
Is the code uploaded?
No. Highlighting happens entirely in the browser and the page sends no requests — internal code never leaves the machine.

Related tools