Google Docs is getting friendlier for typing and showing code

As anyone that has ever tried to paste code into a document can tell you, it can be tricky. Document-writing tools like Microsoft Word andGoogle Docsare meant to make words and sentences readable, and while switching to a monospaced font for those bits of code would fix half of those problems, it’s still far from ideal. Luckily,Google Docsis now aiming to make code easy to display within a document by adding a revolutionary new feature: code blocks.

In normal Word documents, there are plenty of workarounds to properly display a code block, but there’s no such thing as a proper code block feature. In this regard, Google Docs is outdoing its Microsoft counterpart.As announced by Google, people writing documents on its online platform can now insert snippets of code as code blocks and have them displayed correctly within the document. This code block works as one of many “building blocks” within Docs, together with meeting notes and other features.

4

If you want to check it out, just type out your code in the document (no matter if it looks awful) and go toInsert>Building Blocks>Code Block, and then select the programming language you’ve typed out. Docs will then convert the code you just wrote into a smart code block, automatically applying proper styling and colors. It’s a neat feature that lets you show code as it’s meant to be shown, not only making its readability easier but also making things easier for collaborators within a document as well.

The feature is now rolling out to select Google Workspace business accounts, and it might take a few weeks for it to reach everyone. Sadly, though, the blog post says that the feature won’t be rolling out to Google personal accounts, so it looks like most people will be missing out on the fun. Who knows if it’ll arrive in the future, though?

Image shows the Google Docs icon over a blurred screenshot of the Google Docs main page. Many previously made documents are displayed in the background.

The note-taking app I should have used all along

Broader branding hints at wider paid-tier ambitions

An animation of how code blocks work in Google Docs

Generative AI, now poolside

Tablets and accessories are also on sale

Browsers

Perfect for all types of devices

A great choice for those looking for value

Samsung Notes logo in front of image containing S Pen and devices using Samsung Notes