Complete Guide: How to add code blocks to Google docs 2021.

Step by step guide : How to add code blocks to google docs.

If you are a developer or familiar with the world of IT and programming. You must have come across situations where you would like to add code block written in javascript, python, HTML, etc in your google docs. This tutorial is about how to add code blocks to Google docs which will help you add the code blocks in few steps.

But first what exactly do we need?

The answer is we only need one add-on from Google Workspace Marketplace which is code blocks.

Code blocks make it easy to insert your code written in the most commonly used language into google docs. You just need to select your text in google docs and select format . You can also preview the selected text and change the theme as well.

Follow the below step-by-step guide on ” How to add code blocks to Google docs ” to easily add code blocks

Step 1: Open your google docs make sure you’re logged in to your google Gmail account.

Step 2: Go to addon menu and select Get add-ons as shown below.

How to add code blocks to Google docs

Step 3: Once you click on Get add-ons you will be get the Google Workspace Martketplace screen

Type code blocks in the search bar as you see in the below screenshot the auto-suggest shows Code blocks as the first option when your type code.

Select the first search result code blocks as shown below

Step 4: Install the Code blocks addon.

Click on continue.

Once you click continue, it will prompt you to sign in to your Google Gmail account.

Sign in to your Gmail account.

Step 5: Click on “allowto provide code blocks the necessary permission to access google docs


Step 6 : From the main menu goto ->Add-ons->Code Blocks->Start option as shown below

Once you click on the Start option it will pop up the Code block window

Step 7 : Type your code in google docs .

  • Now your are ready to type your code in google docs .
  • It can be javascript,python,perl ,powershell etc .
  • Check the drop down option under Languages in Code blocks window for all the supported languages.

Type your code and select the language in the Code blocks.In the below example it is javascript.

Select your code and click on format. Your code will now appear as a Code block in google docs.

You can also preview your code block with the preview option. Once you select your code and click on the preview option. You will see how your code block will appear in google docs.

Another useful guide:

How to make a Google form link

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.