# Scala worksheet and Scala REPL

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/idea/2026.3/llms.txt).

You can quickly evaluate and run Scala code using a Scala worksheet or Scala REPL.

Scala REPL in IntelliJ IDEA and Scala worksheets both use Scala REPL from the Scala compiler. So, you can use a Scala worksheet instead of Scala REPL to evaluate expressions.

Procedure: Create an .sc file

1. Right-click your project and select `New | Scala Worksheet`. We recommend that you create an `.sc` file in the `src` directory to avoid problems with code highlighting.

2. In the New Scala Worksheet window, type the name of the file and click OK.

As a result, a file with `.sc` extension opens.

Procedure: Run Scala code using Scala worksheet

1. Create a [Scala worksheet](#create_sc_file) file and open it in the editor.

![Scala worksheet](https://resources.jetbrains.com/help/img/idea/2026.3/sc_worksheet.png)

2. Add your code.

Besides standard actions such as code completion and string formatting, IntelliJ IDEA supports the following actions:

* Evaluating Scala objects

* Folding the output without affecting your code on the left side and expanding only that block of the output that matches a specific statement. ![Scala worksheet - unfolded results](https://resources.jetbrains.com/help/img/idea/2026.3/sc_wsheet_unfold.png)

3. Click ![the Run button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.gutter.run.svg) to see the results.

Procedure: Work with the current worksheet settings

1. Open a Scala worksheet file in the editor. Click ![the Settings icon](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.settings.svg) on the toolbar of the worksheet editor to open the Worksheet settings dialog.

2. In the Worksheet Settings dialog, configure the current worksheet settings or the default worksheet settings for the whole project that will affect other worksheets.

![Scala Worksheet Settings dialog](https://resources.jetbrains.com/help/img/idea/2026.3/sc_ws_settings.png)

3. Use the following options for your configuration:

* Interactive Mode: show results automatically.

* Build project before run: enable or disable automatic checking of project changes. Disabling the option can improve evaluation performance.

* Run type: select the appropriate evaluation mode. For example, select the [REPL](https://docs.scala-lang.org/overviews/repl/overview.html) type to quickly evaluate Scala expressions. When you add new expressions they are executed incrementally.

* Use class path of module: this field is disabled since the worksheet is a file that you can share between other projects and should stay where you created it. You can change its location in the default settings, but it will be applied across the whole project and will affect other worksheets. If you need to change a class path, we recommend that you create and use a [scratch file](scratches.html) instead. ![sc_scratch_file.png](https://resources.jetbrains.com/help/img/idea/2026.3/sc_scratch_file.png)

* Compiler profile: in this field select a compiler profile for your worksheet. Select one from the list or click ![the Settings icon](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.settings.svg) to access the Scala compiler settings for more options. > **Note:** > If you add or change a profile through the compiler settings page, and you have an [sbt project](sbt-support.html), your changes will be discarded on the next project import.

> **Tip:**
> To remove the worksheet's results, click ![the Clear results button](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.gc.svg).
>
>
>
> To copy your code and evaluation results to the clipboard, click ![the Copy to Clipboard button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.copy.svg).

Procedure: Start Scala REPL

1. Open Scala REPL by pressing `Ctrl+Shift+D` (Windows), `⌘ ⇧ D` (macOS), `⌘ ⇧ D` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ D` (macOS System Shortcuts), `Ctrl+Shift+D` (XWin), `Ctrl+Shift+D` (GNOME), `Ctrl+Shift+D` (KDE), `Ctrl+Shift+D` (Emacs), `Ctrl+Shift+D` (Sublime Text), `⌘ ⇧ D` (Sublime Text (macOS)), `Ctrl+Shift+D` (Visual Studio), `⌘ ⇧ D` (Visual Studio (macOS)), `Ctrl+Shift+D` (NetBeans), `Ctrl+Shift+D` (Eclipse), `⌘ ⇧ D` (Eclipse (macOS)) or by going to `Tools | Scala REPL` in the main menu.

Alternatively, press `Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `Ctrl+Shift+A` (Visual Studio), `⌘ ⇧ A` (Visual Studio (macOS)), `Ctrl+I` (NetBeans), `Ctrl+Shift+A` (Eclipse), `⌘ 3` (Eclipse (macOS)) to open the Actions tab in the Search Everywhere window, start typing Scala REPL, and then select it from the search results.

![Search Everywhere](https://resources.jetbrains.com/help/img/idea/2026.3/search_everywhere_repl.png)

> **Note:**
> You can also use a [Scala worksheet](#run_scala_worksheet) to start and work with Scala REPL.

2. To run a method from your project, import a given class or module, and call it, as if you were writing regular code.

3. Check the result in the Run tool window.

![Scala REPL](https://resources.jetbrains.com/help/img/idea/2026.3/scala_repl.png)

