# Create your first Kotlin Notebook Note: Starting with IntelliJ IDEA 2026.2, Kotlin Notebook will no longer be bundled with the IDE or officially supported by JetBrains. The source code will remain available on [GitHub](https://github.com/Kotlin/kotlin-notebook). Learn more in the [blog post](https://blog.jetbrains.com/idea/2026/06/kotlin-notebook-sunset/). You can start working with your [Kotlin Notebook](kotlin-notebook-overview.html) in three main ways: * [Create a new project that includes a Kotlin Notebook](#create-a-new-project) * [Add a Kotlin Notebook to an existing project](#add-a-new-kotlin-notebook-to-your-project) * [Create a scratch Kotlin Notebook](#create-a-scratch-kotlin-notebook) ## Create a new project To create a new project that includes a Kotlin Notebook: 1. In IntelliJ IDEA's welcome screen, select Kotlin Notebook | New Notebook from the panel on the left. 2. Enter a Name for your new notebook and select Type | In Folder. * Scratch: This option is to create a scratch notebook without adding it to a project. * In Folder: This option is to create a notebook within a project. You have to specify the project's location. 3. Click Create. ![Create a new Kotlin Notebook from IntelliJ IDEA](images/create-notebook-welcome.png) Your new Kotlin Notebook is created within a new project. Alternatively, create an empty project and then [add a Kotlin Notebook](#add-a-new-kotlin-notebook-to-your-project): 1. In IntelliJ IDEA, select File | New | Project. 2. In the panel on the left, select New Project. 3. Name the new project and change its location if necessary. Tip: Select the Create Git repository checkbox to place the new project under version control. You will be able to do it later at any time. 4. From the Language list, select Kotlin. ![Create a new Kotlin Notebook project](images/new-notebook-project.png) 5. Select the IntelliJ build system. 6. From the JDK list, select the [JDK](https://www.oracle.com/java/technologies/downloads/) that you want to use in your project. 7. Enable the Add sample code option to create a file with a sample `"Hello World!"` application. Tip: You can also enable the Generate code with onboarding tips option to add some additional useful comments to your sample code. 8. Click Create. Once your project is created, add a new Kotlin Notebook (see the next section). ## Add a new Kotlin Notebook to your project To add a new Kotlin Notebook to an existing project: 1. Select File | New | Kotlin Notebook, or right-click on a folder and select New | Kotlin Notebook. ![Create a new Kotlin Notebook](images/new-notebook.png) 2. Set the name of the new notebook, for example, first-notebook. 3. Press Enter. A new tab with a Kotlin Notebook first-notebook.ipynb opens. ## Create a scratch Kotlin Notebook You can also create a Kotlin Notebook as a scratch file. [Scratch files](https://www.jetbrains.com/help/idea/scratches.html#create-scratch-file) allow you to test small pieces of code without creating a new project or modifying an existing one. To create a scratch Kotlin Notebook: 1. Click File | New | Scratch File. 2. Select Kotlin Notebook from the New Scratch File list. ![Scratch notebook](images/kotlin-notebook-scratch-file.png) ## Perform basic operations 1. In the new Kotlin Notebook, type the following code in the code cell: ```KOTLIN println("Hello, this is a Kotlin Notebook!") ``` 2. To run a code cell, click the Run Cell and Select Below ![Run Cell and Select Below](images/run-cell-and-select-below.png) button or press Shift + Return. 3. Add a markdown cell by clicking on the Add Markdown Cell button. 4. Type `# Example operations` in the cell, and run it the same way you run code cells to render it. 5. In a new code cell, type `10 + 10` and run it. 6. Define a variable in a code cell. For example, `val a = 100`. Tip: Once you run a code cell with defined variables, those variables become accessible in all other code cells. 7. Create a new code cell and add `println(a * a)`. 8. Run all code and markdown cells in the notebook using the Run All ![Run all button](images/run-all-button.png) button. ![First notebook](images/first-notebook.png) Congratulations! You have just created and tried out your first Kotlin Notebook. ## Next step In the next part of the tutorial, you will learn how to add dependencies to a Kotlin Notebook. * [Previous step](kotlin-notebook-set-up-env.html) * [Next step](kotlin-notebook-add-dependencies.html)