Code Syntax Highlighter
Preview code with simple coloring for strings, numbers and selected keywords, optional line numbers, and copying of the original source.
Start using
Code Syntax Highlighter
Preview code with simple coloring for strings, numbers and selected keywords, optional line numbers, and copying of the original source.
The language selector and simple automatic detector change only the language label. All seven choices use the same small, case-insensitive set of rules for quoted strings, numbers and selected keywords. HTML tags, attribute names, punctuation and comments have no separate grammar; choosing a language does not improve token recognition.
const x = 42;
Enter at most 500,000 UTF-16 code units (an emoji can use two), choose line numbers, then click Generate highlighted code. For const x = 42;, const and 42 receive colors; punctuation stays plain. Pasted HTML is displayed as text and is not executed. Copy returns the last generated original source, including newlines, without labels or line numbers. Clear empties input and result but keeps the options. This is a visual aid, not a compiler, linter or security check.
Processing takes place locally in your browser.