Skip to main content

Google Docs rolling out code blocks for easier formatting and display

Google’s latest Smart canvas feature for Docs is code blocks that let you more easily format and display code.

Once rolled out, paste/write your code and then Insert > Building blocks, which will offer a new “Code block” menu. The five available options are C/C++, Java, JavaScript, Python, and Unset.

Code blocks in Google Docs feature a light gray background, while the chosen language is noted in the top-left corner. Previously, “collaborators who want[ed] to present code [had] to paste it in the document and then manually apply styles by highlighting syntax.”

The goal is to make code more readable in Google Docs and improve collaboration. Besides the menu, you can easily add by using @-search > Code blocks > choose your programming language, while those with Markdown enabled can type “` and press Enter.

This is starting to roll out today and will be fully launched over the coming weeks:

  • Available to Google Workspace Business Standard, Business Plus, Enterprise Standard, Enterprise Plus, Education Standard, Education Plus customers, and Nonprofits 
  • Not available to Google Workspace Essentials, Business Starter, Enterprise Essentials, Education Fundamentals, the Teaching and Learning Upgrade, Frontline, nor legacy G Suite Basic and Business customers 
  • Not available to users with personal Google Accounts

More on Google Docs:

FTC: We use income earning auto affiliate links. More.

You’re reading 9to5Google — experts who break news about Google and its surrounding ecosystem, day after day. Be sure to check out our homepage for all the latest news, and follow 9to5Google on Twitter, Facebook, and LinkedIn to stay in the loop. Don’t know where to start? Check out our exclusive stories, reviews, how-tos, and subscribe to our YouTube channel

Comments

Author

Avatar for Abner Li Abner Li

Editor-in-chief. Interested in the minutiae of Google and Alphabet. Tips/talk: abner@9to5g.com