How to Format Code in Google Docs

post-title

There might be times when you have to share part of your code or full code on google docs. Generally when you simple paste the code in google docs file it doesn’t look much readable as a code block. To make it more readable like it does in code editor you must use Code Blocks by Alex Forsythe.

Open Code Blocks install page and click install. After that open a new or existing document.

Install Code Blocks

Click on Add-ons > Code Blocks > Start

Open Code Block

This will open a dialogue box on the right side.

Code Blocks

Now select the code which you want to format and click on preview in Code Blocks window.

Code Blocks Preview

This will show you how your code gonna look using Code Blocks. Now click on Format and you code on your document will be formatted properly.

Code Block Format

So this is how you must format your code in google docs. Without using Code Blocks your code won’t look much pleasing and readable.