Convert IPYNB to PY in Your Browser
Turn a Jupyter Notebook (.ipynb) into a plain Python script, with cell boundaries kept as # %% markers so it opens straight back in VS Code, Spyder, or Jupyter. No Python install and no upload: the notebook never leaves your device.
Drag and drop, paste, or click to select Tap to select a .ipynb file
Files are processed on your device only.
How it works
- Drop or select your .ipynb file. It is parsed on your device only.
- Check the notes: they list how many cells had outputs that cannot come along.
- Click Download .py to save the script.
Cell markers, so the script is not a one-way dump
A notebook has structure that a flat script normally throws away. This converter keeps it: every code cell is written under a line reading # %%, and every markdown cell under # %% [markdown] with its prose commented out. That is the percent format, and VS Code, Spyder, PyCharm, and jupytext all treat those lines as cell boundaries rather than as ordinary comments.
The practical effect is that the export is reversible. Open the .py in VS Code and you get the same cells back with a Run Cell button above each one, or feed it to the PY to IPYNB converter to rebuild the notebook. See how browser-side rendering works for the pipeline behind every converter here.
Why the outputs cannot come with you
A .ipynb file stores two different things: the code you wrote and the results of running it, including base64 images of every chart, rendered HTML for pandas tables, and the colored text of any traceback. A .py file is source code and nothing else, so those results have nowhere to go. This is true of jupyter nbconvert --to script as well; it is a property of the target format, not a limitation of this tool.
The converter counts the cells that had saved outputs and says so, rather than dropping them silently. If the results are the point, keep the rendered version instead: IPYNB to PDF for a paginated document, or IPYNB to HTML for a single self-contained web page.
Frequently asked questions
- What is lost when a notebook becomes a .py file?
- The outputs. Charts, pandas tables, printed text, and error tracebacks are results stored in the notebook, and a Python file has nowhere to keep them, so they are dropped and the tool tells you how many cells had them. The code itself, the cell boundaries, and the markdown prose all survive. Export to PDF or HTML instead if you need the results.
- Will the exported script still open as a notebook later?
- Yes. Cells are separated with the percent format, a line reading # %% before each one, which VS Code, Spyder, PyCharm, and jupytext all read as a cell boundary. The same markers are what the PY to IPYNB converter here splits on, so the file round-trips without you editing anything.
- What happens to markdown cells?
- Each one becomes a commented block under a # %% [markdown] header, which is what jupyter nbconvert does as well. Nothing is discarded and the script still runs, because every line of prose is a comment. Convert the file back and those blocks return as markdown cells rather than code.
- Does my notebook get uploaded?
- No. A notebook is JSON, so it is parsed and rewritten entirely in your browser on your own device. There is no upload endpoint, no account, and the converter keeps working with the network disconnected.