How to Add Code Block in Google Docs

HomeGoogleHow to Add Code Block in Google Docs

How to Add Code Block in Google Docs

When writing a document in Google Docs you might sometimes want to add a code block. By default, Google Docs has no option to allow you turn text into a code block. There is an add-on you can use to put your code to Google Docs. It is Code Blocks. This add-on it pretty easy to use. All you need to do is highlight the text you want to turn into code block and format it.

Code Blocks supports lots of programming languages. From HTML, PHP, Python, C, JavaScript and so on. You can also select a theme you like.

Install Code Blocks

Before being able to use Code Blocks you surely have to install it first. This add-on is free to use. Here is how to install this add-on.

  • Open Google Docs on your browser.
  • Visit this page on click the Free button to add it to your Google Docs.

  • Code Blocks needs your permission to run. Simply click the Continue button on the appearing pop-up.

  • Select your Google account and click the Allow button.

That’s it. You have successfully installed Code Blocks to your Google Docs.

How to use Code Blocks

Once you have successfully installed Code Blocks on Google Docs, you will have a new item called Code Blocks under the Add-ons menu. You can simply click it and select Start and a new sidebar will appear. But first, you need to highlight the text you want to turn into code block. Code Blocks will automatically recognize your code. Before formatting the text, you can preview the changes first.

Manage Code Blocks

To enhance the functionality of Google Docs, Google allows developers to create add-ons. Code Blocks is one of add-ons developed by third party developer. You can manage the add-ons on Google Docs by going to Add-ons –> Manage add-ons.

Select the add-on you want to manage and click the MANAGE button.


hand-picked weekly content in your inbox


related posts


  1. I can’t install code blocks or code pretty. Sign in with Google temporarily disabled for this app. This app has not been verified yet by Google in order to use Google Sign In.


Please enter your comment!
Please enter your name here