Data Format Conversions
Jupyter Notebook to Python Converter
Workspace
Options
How to use this tool
- 1Open an .ipynb file (or paste its JSON).
- 2Choose cell markers: # %% cells (VS Code, PyCharm, Spyder, Jupytext) or a plain script.
- 3Choose how Markdown and magics are handled.
- 4Download the .py file.
Frequently asked questions
They split the script into cells that VS Code, PyCharm, Spyder and Jupytext can run one at a time, just like a notebook. Choose Plain script for a normal .py file.
They are IPython-only syntax. Comment out keeps the script runnable with plain python; get_ipython() calls keep them working under the ipython command.
No. Outputs, images and execution counts are not part of the code, so only cell sources are converted.
The cells are copied, but the result is not Python; the tool warns you when the notebook kernel is not Python.
No. The conversion runs in your browser with JavaScript. Your file or pasted text is not uploaded, logged or stored by MuhammadLab.
Related tools
Python to TXT Converter
Convert Python source code to a clean .txt file, with optional comment removal, line numbers and whitespace clean-up.
JSON to Python Converter
Convert JSON to a Python dict literal, or generate dataclasses, TypedDicts or Pydantic models from it.
Python Dict to JSON Converter
Convert Python dict, list, tuple and set literals to valid JSON with a safe parser.
reStructuredText to Markdown Converter
Convert reStructuredText to GitHub-flavoured Markdown: headings, code fences, tables, notes and footnotes.