Skip to content
| Marketplace
Sign in
Visual Studio Code>Notebooks>Text as NotebookNew to Visual Studio Code? Get it now.
Text as Notebook

Text as Notebook

Martin Söderström

|
2 installs
| (0) | Free
Open percent-format text files (# %% cells) and jupytext-Markdown .md files as native notebooks with real kernels. The file on disk stays plain text.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Text as Notebook

Open any Python (.py) or Markdown (.md) file as a native VS Code notebook. In Python, each # %% marker starts a new cell. In Markdown, language-tagged code fences create code cells (```python [code]```). The file stays plain text on disk; no paired .ipynb file is created.

This extension uses the same plain-text notebook formats as Jupytext. It does not pair or synchronize text files and .ipynb files: conversion is explicit, and supported text files can be opened, edited, and run as notebooks.

Usage

  1. Install the extension and the Jupyter extension.
  2. In the Explorer, right-click a .py, .md, or .markdown file and select Text as Notebook → Open as Notebook. You can also run Open as Notebook from the Command Palette.
  3. Select a kernel, edit and run cells, then save. The original text file is updated.

Text as Notebook menu with Open as Notebook selected Text as Notebook option in the Command Palette

Opening a file normally still opens it as text. This extension does not change the default editor for Python files.

Notebook outputs are temporary because text files do not store them. Use Save as .ipynb with Outputs to create an .ipynb snapshot when you need to keep outputs.

Save as .ipynb with Outputs command

Commands

All Explorer commands are under Text as Notebook.

Command Description
Open as Notebook Open a .py, .md, or .markdown file in the notebook editor.
Open as Text Return an open text-backed notebook to the text editor.
New Percent Notebook Create and open a new .py notebook with a # %% cell.
New Markdown Notebook Create and open a new Markdown notebook.
Save as .ipynb with Outputs Save the current notebook, including outputs, as an .ipynb file.
Convert to .ipynb Create an .ipynb copy of a text notebook.
Convert to .py (# %% script) Create a percent-format Python copy of an .ipynb notebook.
Convert to .md Create a Markdown copy of an .ipynb notebook.
Convert Cell Markers to # %% Convert supported foreign Python cell markers to # %%.

Conversions are one-way: the source file is unchanged, and the two files are not kept in sync. Converting an .ipynb to text does not keep its outputs.

Requirements

  • VS Code 1.90 or newer.
  • The Jupyter extension.
  • A Jupyter kernel.

Verified compatible with jupytext 1.19.4

  • Python notebooks in Jupytext's py:percent format (the # %% plain-text format).
  • Markdown notebooks in Jupytext's md format.
  • Not supported: other Jupytext formats, including py:light, MyST Markdown, R Markdown, and Quarto; other notebook text formats such as .sql are also unsupported.
    • Convert Cell Markers to # %% can convert recognized Python marker conventions—including Jupytext py:light, Databricks, and legacy Jupyter markers—to py:percent.

Limitations

  • The desktop VS Code app is supported. Browser-only vscode.dev and github.dev are not supported.
  • macOS has CI coverage but has not been manually tested.

Contributing

See CONTRIBUTING.md.

Credits

  • jupytext for the supported text formats.
  • The VS Code Jupyter extension for notebook editing and kernels.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft