Paste code into Google Docs with syntax highlighting

Copy a readable code snippet into Google Docs for reports, tutorials, project notes, and shared technical documentation.

How to add formatted code to Google Docs

  1. Paste code and choose its language.
  2. Copy the highlighted result.
  3. Paste it into the shared document.

When should I use a code image?

Export a PNG, JPEG, or SVG when a report, tutorial, or presentation needs a fixed visual example.

Start highlighting code · Code to Word · Supported languages