Skip to content

Go Syntax Highlighter

Highlight Go (Golang) source code with keywords, types and strings coloured, exported as HTML.

Runs in your browserGo → HTML
Loading tool…

Example

Input
func main() { fmt.Println("hi") }
Output
<pre class="hljs"><code class="language-go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> { fmt.Println(<span class="hljs-string">&quot;hi&quot;</span>) }</code></pre>

How to use the Go Syntax Highlighter

  1. Paste or type your Go into the input area, or open a file from your device.
  2. Adjust the options above the editor if the tool offers any.
  3. Review the HTML result, then copy it or download it as a file.

Privacy and limitations

  • Your data is processed on your device and is not uploaded to any server.

Browse all syntax highlighting →