On any Notion page, you can create a code block to display code so that it's broken out from the rest of your content and formatted by language. We support proper syntax coloring for a number of programing languages. For example, here's a Code block displaying JavaScript:

for (i = 0; i < 5; i++) {
  text += "The number is " + i + "<br>";
}

Code blocks are useful to demonstrate programing concepts, share code with other developers, or maintain your own library of code snippets. They also make it a breeze to copy any amount of code to your clipboard to use elsewhere.

Add a code block

Arrange code blocks

Wrap your code

To eliminate side scrolling and create a line break at the edge of your code block:

Copy code to clipboard