Syntax highlighter

Syntax highlighter: Adds syntax highlighting to a range of source code languages.

Free · No sign-up required

Text input

Your result is ready to copy or download after running.

Tool options

About Syntax highlighter

Adds syntax highlighting to a range of source code languages. Note that this will not indent the code. Use one of the 'Beautify' operations for that.

Input: text. Output: HTML with a sandboxed preview.

Format reference: Syntax highlighter background and specification

Example

Use “Try example” to load this public sample and its settings, then run it.

Settings used in this example
ParameterExample valueInput and choices
LanguagejavascriptText
194 Available choices
  • auto detect
  • 1c
  • abnf
  • accesslog
  • actionscript
  • ada
  • angelscript
  • apache
  • applescript
  • arcade
  • arduino
  • armasm
  • xml
  • asciidoc
  • aspectj
  • autohotkey
  • autoit
  • avrasm
  • awk
  • axapta
  • bash
  • basic
  • bnf
  • brainfuck
  • c
  • cal
  • capnproto
  • ceylon
  • clean
  • clojure
  • clojure-repl
  • cmake
  • coffeescript
  • coq
  • cos
  • cpp
  • crmsh
  • crystal
  • csharp
  • csp
  • css
  • d
  • markdown
  • dart
  • delphi
  • diff
  • django
  • dns
  • dockerfile
  • dos
  • dsconfig
  • dts
  • dust
  • ebnf
  • elixir
  • elm
  • ruby
  • erb
  • erlang-repl
  • erlang
  • excel
  • fix
  • flix
  • fortran
  • freedesktop
  • fsharp
  • gams
  • gauss
  • gcode
  • gherkin
  • glsl
  • gml
  • go
  • golo
  • gradle
  • graphql
  • groovy
  • haml
  • handlebars
  • haskell
  • haxe
  • hsp
  • http
  • hy
  • inform7
  • ini
  • irpf90
  • isbl
  • java
  • javascript
  • jboss-cli
  • json
  • julia
  • julia-repl
  • kotlin
  • lasso
  • latex
  • ldif
  • leaf
  • less
  • lisp
  • livecodeserver
  • livescript
  • llvm
  • lsl
  • lua
  • makefile
  • mathematica
  • matlab
  • maxima
  • mel
  • mercury
  • mipsasm
  • mizar
  • perl
  • mojolicious
  • monkey
  • moonscript
  • n1ql
  • nestedtext
  • nginx
  • nim
  • nix
  • node-repl
  • nsis
  • objectivec
  • ocaml
  • openscad
  • oxygene
  • parser3
  • pf
  • pgsql
  • php
  • php-template
  • plaintext
  • pony
  • powershell
  • processing
  • profile
  • prolog
  • properties
  • protobuf
  • puppet
  • purebasic
  • python
  • python-repl
  • q
  • qml
  • r
  • reasonml
  • rib
  • roboconf
  • routeros
  • rsl
  • ruleslanguage
  • rust
  • sas
  • scala
  • scheme
  • scilab
  • scss
  • shell
  • smali
  • smalltalk
  • sml
  • sqf
  • sql
  • stan
  • stata
  • step21
  • stylus
  • subunit
  • swift
  • taggerscript
  • yaml
  • tap
  • tcl
  • thrift
  • tp
  • twig
  • typescript
  • vala
  • vbnet
  • vbscript
  • vbscript-html
  • verilog
  • vhdl
  • vim
  • wasm
  • wren
  • x86asm
  • xl
  • xquery
  • zephir

Input

const answer = 42;

Result

The result is shown in the preview; download it to inspect the generated content.

Parameters

ParameterDefault valueInput and choices
Languageauto detectText
194 Available choices
  • auto detect
  • 1c
  • abnf
  • accesslog
  • actionscript
  • ada
  • angelscript
  • apache
  • applescript
  • arcade
  • arduino
  • armasm
  • xml
  • asciidoc
  • aspectj
  • autohotkey
  • autoit
  • avrasm
  • awk
  • axapta
  • bash
  • basic
  • bnf
  • brainfuck
  • c
  • cal
  • capnproto
  • ceylon
  • clean
  • clojure
  • clojure-repl
  • cmake
  • coffeescript
  • coq
  • cos
  • cpp
  • crmsh
  • crystal
  • csharp
  • csp
  • css
  • d
  • markdown
  • dart
  • delphi
  • diff
  • django
  • dns
  • dockerfile
  • dos
  • dsconfig
  • dts
  • dust
  • ebnf
  • elixir
  • elm
  • ruby
  • erb
  • erlang-repl
  • erlang
  • excel
  • fix
  • flix
  • fortran
  • freedesktop
  • fsharp
  • gams
  • gauss
  • gcode
  • gherkin
  • glsl
  • gml
  • go
  • golo
  • gradle
  • graphql
  • groovy
  • haml
  • handlebars
  • haskell
  • haxe
  • hsp
  • http
  • hy
  • inform7
  • ini
  • irpf90
  • isbl
  • java
  • javascript
  • jboss-cli
  • json
  • julia
  • julia-repl
  • kotlin
  • lasso
  • latex
  • ldif
  • leaf
  • less
  • lisp
  • livecodeserver
  • livescript
  • llvm
  • lsl
  • lua
  • makefile
  • mathematica
  • matlab
  • maxima
  • mel
  • mercury
  • mipsasm
  • mizar
  • perl
  • mojolicious
  • monkey
  • moonscript
  • n1ql
  • nestedtext
  • nginx
  • nim
  • nix
  • node-repl
  • nsis
  • objectivec
  • ocaml
  • openscad
  • oxygene
  • parser3
  • pf
  • pgsql
  • php
  • php-template
  • plaintext
  • pony
  • powershell
  • processing
  • profile
  • prolog
  • properties
  • protobuf
  • puppet
  • purebasic
  • python
  • python-repl
  • q
  • qml
  • r
  • reasonml
  • rib
  • roboconf
  • routeros
  • rsl
  • ruleslanguage
  • rust
  • sas
  • scala
  • scheme
  • scilab
  • scss
  • shell
  • smali
  • smalltalk
  • sml
  • sqf
  • sql
  • stan
  • stata
  • step21
  • stylus
  • subunit
  • swift
  • taggerscript
  • yaml
  • tap
  • tcl
  • thrift
  • tp
  • twig
  • typescript
  • vala
  • vbnet
  • vbscript
  • vbscript-html
  • verilog
  • vhdl
  • vim
  • wasm
  • wren
  • x86asm
  • xl
  • xquery
  • zephir

Before interpreting the result

Formatters change layout; minifiers reduce unnecessary formatting. Parsing requirements differ by language. Preserve original bytes when signatures or checksums depend on them.

How to use this page

  1. Paste your input or open a local file.
  2. Adjust tool options if needed, then choose Run tool.
  3. Copy the result or download the original output bytes.

Inputs and results are not added to the public catalogue or saved in the URL. Processing happens in your browser; HTTP Request and DNS over HTTPS send the requests you explicitly run. Files up to 128 MiB can be opened; decompression and image tools may have smaller processing limits. Large results have a shortened preview. Text and HTML downloads use UTF-8; binary downloads preserve output bytes. Pasted text follows browser newline handling; open a file when exact input bytes matter.

Related tools

Browse code tidy tools