How to convert IPYNB to Python
- Drop your IPYNB file on the box above, or paste its content into the text box.
- Check the settings below the box; the defaults suit most files.
- Press Convert. You see a preview or a summary of the result.
- Download the .py file, or copy the text.
What is kept when you convert IPYNB to Python
- Code cells are written in order, each marked with a # %% line that VS Code, PyCharm and Spyder recognise as a runnable cell.
- Markdown cells become comments (or are left out, if you choose).
- IPython magics (%matplotlib, %%time) and shell lines (!pip install) are commented out, because they are not valid Python outside Jupyter. Outputs are not included.
Example
For a notebook with a Markdown cell and a code cell that starts with %matplotlib inline, the script is:
Output
# Exported from a Jupyter notebook by EasyCalculatorSmart.
# Markdown cells are comments; IPython magics (%) and shell commands (!) are commented out.
# %% [markdown]
# # Growth
# Rate $g = b/a - 1$.
# %% In[1]
# %matplotlib inline
print(150 / 120 - 1)
About IPYNB and Python files
An .ipynb file is a Jupyter notebook: a JSON document holding Markdown cells, code cells and the outputs (text, tables, charts) saved the last time the cells were run. It opens in Jupyter, JupyterLab, VS Code, Google Colab.
A .py file is a Python script: plain code that runs from top to bottom, without the cells and saved outputs a notebook has. It opens in any Python interpreter, VS Code, PyCharm, Spyder.
Good to know
- Outputs are only as fresh as the last run. Run all cells and save the notebook in Jupyter before converting if you need current results.
- Run the script once from a terminal before relying on it: notebooks often depend on cells being run in a different order.
Privacy and limits
The file is read and converted by this page in your browser; there is no upload and no account. Notebook code is never executed — only the saved cells and outputs are converted. Files up to 25 MB are accepted; a file of the wrong type or a damaged file is rejected with the reason.