Google Docs, the popular spreadsheet and document management software, has just added a new feature that may be of interest to some users: code blocks. Code blocks are a type of blockquote that can be used to include code snippets in your documents. They can also be used to highlight or underline specific portions of text, making them easier to read. The code block feature is available in Google Docs for both Mac and PC. You can find the link to the Google Docs website on the main page of the company’s website. If you’re not familiar with code blocks, they’re a great way to add some extra functionality to your documents without having to learn all of the different syntaxes involved. They’re also a great way to show off your coding skills in a more professional setting.


Google Docs is one of the most popular ways to create and share text documents, but up until now, sharing code samples has been a bit cumbersome. That’s finally changing.

Google said in a blog post today, “currently, when working in Google Docs, collaborators who want to present code have to paste it in the document and then manually apply styles by highlighting syntax. We’re adding a new smart canvas feature that makes this process much easier by enabling you to format and display code in Docs with code blocks.”

There’s a new option to insert a code block rolling out, accessible from Insert > Building blocks > Code block. From there, you can pick from a few different programming languages, such as Java, Python, C++, and JavaScript. Google Docs will then create a block and provide the correct color formatting for the selected language. You can also just type the @ symbol in a document, then “code blocks.”

The new code blocks should come in handy for anyone working on programming tutorials, code project examples, or anything else in Google Docs that might need to include code samples.

Google says the feature should roll out within the next 15 days, but it’s not available to personal Google accounts (e.g. Gmail logins) yet, only Workspace accounts provided by a company or other organization. It’s not clear when, or if, everyone will be able to try it.

Source: Google Workspace Updates