How to Add a Code Block in Notion
In this article
You can easily add code blocks to your Notion pages to display and format code snippets. This guide will walk you through the steps to insert a code block and add your code.
Explore more Notion tutorials with interactive Saltfish walkthroughs.
Here's how to add a code block in Notion
- Open Your Notion Page
Begin by opening the specific Notion page where you intend to add a code block. This ensures your code snippet is placed in the correct context.
- Add a New Block
Locate and click the "+" button on your Notion page. This action opens a menu displaying various block types you can add to your page.
- Select the Code Block Type
From the list of available block types, choose "Code." This will insert a dedicated code block into your Notion page, ready for your input.
- Enter Your Code
Once the code block appears, you can type or paste your code directly into it. Notion will automatically format the code for readability.
- Verify Code Block Display
After entering your code, confirm that it is correctly displayed within the block. Notion's code blocks often include syntax highlighting for better visibility.
Your turn to show how it works.
Build a walkthrough of your product with Saltfish, then share it with your customers.
Frequently Asked Questions
After adding the code block, you'll see a language dropdown (e.g., "JavaScript" in the example) at the top right of the block. Click it to choose your desired programming language for syntax highlighting.


Notion
