Code Blocks for Google Docs™ — syntax-highlighted code blocks, 46 languages, and editor themes for Google Docs™.
Select code anywhere in your Google Doc and turn it into a real code block — syntax highlighting for 46 languages, a monospace font, and a solid themed background, right where you selected it. Pick from 8 editor themes (VS Code, Monokai, GitHub, Solarized, Dracula) with a live preview, switch on line numbers or a language label, and format a whole document of ``` fenced blocks from ChatGPT in one click. Your text, indentation, and links stay exactly as you wrote them, and a single Ctrl+Z undoes everything.
Need help or found a problem? Email us and a person will reply — questions, bug reports, and feedback all welcome.
Contact support: [email protected]- Open a Google Doc and choose Extensions → Code Blocks for Google Docs → Open Code Blocks.
- Select the code in your document and pick a language, or leave it on Auto-detect.
- Click Format code — your code is highlighted with a monospace font and a themed background. Press Ctrl+Z to undo.
- Syntax highlighting for 46 languages — Python, JavaScript, TypeScript, Java, C, C++, C#, SQL, HTML, CSS, Bash, Go, Rust, PHP, Ruby, Swift, Kotlin, R, MATLAB and more — with Auto-detect that names the language for you and remembers it.
- 8 editor themes with a live preview — VS Code Dark+, VS Code Light, Monokai, GitHub Light, GitHub Dark, Solarized Light, Solarized Dark, and Dracula. A live preview card shows the theme, font, and size before you touch your document. Choose from 7 monospace fonts, including Roboto Mono, Fira Code, and JetBrains Mono.
- Your code stays exactly as you wrote it — Formatting writes only color, font, and background — indentation, empty lines, tabs, and links are never changed, and code copied back into your editor still runs. Multi-line code is wrapped in a filled block; a single word or fragment gets an inline code style instead.
- Line numbers, labels, and ChatGPT clean-up — Switch on line numbers or a language label per block. Paste a whole document of ``` fenced blocks from ChatGPT and format them all at once, then Clear code formatting or re-format any block in one click.
Works only with the document you have open. Your code never leaves it — no external servers, no account required.