Convert IPYNB to PY, Free
Files convert instantly in your browser. 100% private, any file size, no account needed.
How to convert IPYNB to PY
Jupyter notebooks (.ipynb) combine code, output, and markdown explanations in a JSON-based format. They are invaluable for exploration and documentation, but when you want to run notebook code in a script, version it cleanly in git, or deploy it in a production pipeline, a plain Python .py file is much more practical. Converting an ipynb to py strips the metadata and output cells, leaving only the code cells as executable Python.
The conversion is handled entirely in your browser using JavaScript. The ipynb format is JSON, and the converter reads each code cell and assembles them in order into a .py file. Markdown cells can optionally be included as Python comments.
Upload your notebook
Drop your .ipynb file into the converter. The browser parses the JSON structure and identifies all code cells.
Choose conversion options
Select whether to include markdown cells as comments, whether to add cell separator comments, and whether to include or strip magic commands like %matplotlib inline.
Convert
The converter assembles the code cells into a single .py file, preserving the order and indentation from the notebook.
Download the Python file
Click Download to save the .py file. Run it with 'python yourscript.py' or import it as a module.
Frequently asked questions
Does the conversion include cell outputs?
No. The .py file contains only the source code from code cells. Outputs (plots, tables, print statements) are generated fresh when you run the script.
What happens to markdown cells?
Markdown cells can be included as Python comments (lines starting with #) or omitted entirely depending on the option you choose.
What about magic commands like %pip install or !bash?
Jupyter magic commands starting with % or ! are IPython-specific and do not run in plain Python. The converter may comment them out or leave them for you to handle.
Is my notebook uploaded to a server?
No. The conversion runs in your browser using JavaScript. Your file stays on your device.
Can I also do this from the command line?
Yes. The Jupyter project provides 'jupyter nbconvert --to script yournotebook.ipynb' which does the same thing natively.