About Uisoftbank

We gather useful software and tips to save your time and money for your business. 

How to Add Code Block to Google Docs Without/With Addon? (Detailed Steps)

In this article, we have discussed different ways that you can use to add code block to Google Docs. Using these ways, you can add codes like a pro.
add code block to google docs

There are times when you need to add code block to Google Docs so that you can share it easily with your team members. But the question is how to add it to Google Docs. In fact, it is not difficult. Adding code blocks is easy if you know the right ways. In this article, we will guide you on how to add code blocks to Google Docs without and with add-ons.  Continue reading the article.

How to Create Google Docs Code Block Without Addon?

Don’t know how to insert code block to Google Docs without Addon? Don’t worry, here are two different ways that you can try to add code blocks. Let’s see them one by one.

Way 1. Insert Code Block to Google Docs Via Inserting Table

Google doesn’t provide any built-in feature to add code blocks to Google Docs, which means you need other ways to insert the code. Luckily, you can add code blocks manually by inserting a table. This process is simple and easy to follow. Let’s discuss the steps.

Step 1: Open Google Docs and open the file where you want to insert the code. Now, from the menu, click the “Insert” option.

how to add code block in google docs

Step 2: To add the code block, you have to choose one table cell to insert and adjust the size to match your requirements.

how to add code blocks in google docs

Step 3:  Once you have inserted the table, adjust the background color to easily highlight the code block. You can click the background color icon for this process.

google docs code block without addon

Step 4: Next, open the editor where you created the code and copy it. Once you have the code, paste it into the cell.

insert code block google docs

Step 5: Once you have pasted the code, change its font by selecting the Text option. Now, choose the Font according to your preference.

how to add block quote in google docs

That’s it! You have finally learned how to add code blocks to Google Docs using the table tool. You can also change the color of your syntax and make it more elegant. Apart from that, you can add code from various programming languages, including HTML code, C++, etc.

If you think this method is time-consuming, don’t worry, here is another method that you can use. Check out the details below to find that method.

Way 2. Add Code in Google Docs Via Opening HTML File

This method is not time-consuming and will add the code block in Google Docs in no time. However, make sure you have created the code using the right tools, including Notepad++, DreamViewer, etc. Once you are done, follow the steps below.

Step 1: First, you have to copy the HTML code from the place you found or created.

Step 2: Next, open Notepad++ and paste the HTML code into it.

notepad ++

Step 3: Now, you have to save the file as .html by clicking “File” > “Save” and choose “html” as the output format.

Step 4: Next, open Google Docs, click “New” > “file upload” to import your code file to Google Docs, then, open the file. Finally, you will see your code.

how do i create address labels in google docs

In Google Docs, you will see the code in the original format. However, you should note that you are not allowed to edit the uploaded code file.

So, these are the two different ways that you can use to insert code blocks into Google Docs. In case you don’t want to add the code manually and are looking for an add-on, then below is another way that you can try. Let’s see how this method works.

How to Add Code block in Google Docs With Addon?

Since Google Docs doesn’t add built-in features to add the code, there are multiple add-ons that you can use. Yes, that is correct! You can quickly install an add-on and add the code without worrying about anything. Also, the best part is that you don’t need any technical expertise for this method. Now, let’s follow the steps below.

1. Open a Google Docs document and choose the “Extension” option from the menu.

2. Now, choose the ‘Get add-ons’ option.

add code block to google docs with addons

3. After that, look for the “Code Blocks” option.

search code blocks option in google docs

4. You will see different add-ons on the screen, so choose the right one and click on it.

5. Now, click the “Install” option and hit the “Continue” button.

install code block in google docs

6. Choose the email account which you want to add and give access by clicking the “Allow” option.

8. Finally, the add-on is installed on your Google Docs, and you can now use it to add the code. Just open the Extension, click the “Code Blocks” button, and you are good to go.  

Use code blocks in google docs

You can also change the code format by clicking the “Format” option.

Final Words

So, these are the two ways that you can use to add code blocks to Google Docs. Both ways are straightforward, and you can follow them easily. In case you still face any issues, feel free to contact us, and we will definitely guide you. Also, if you need more information, don’t forget to check our FAQs section.


Q1. How to add block quote in Google Docs?

To do that, just choose the text you want to add block quotes, and hit the “Increase indent formatting” option. After that, drag the indicator and set the Line spacing.

Q2. How do I create address labels in Google Docs?

To create the address labels, you first have to download the Create & Print labels extension. After that, choose the template provided by Google Docs and adjust the formatting. Once everything is done, print it, and you are good to go.  

Q3. How to add a line to a Google Doc?

To add the link, follow the steps below.

  1. Open your document and click the “Select line” option.
  2. Pick your line type and place it on your drawing.
  3. Once you have chosen the right option, click the “Select” button.

You May Also Like

Quip Vs Google Docs: A Detailed Comparison

Notion Vs Google Docs: What Are The Differences

5 Best Google Sheets Alternative to Easier Your Work

Share This Post