IPYNB to PDF converter
Save notebooks as formatted A4 or Letter PDFs with charts and tables intact.
Convert to PDFFree · runs 100% in your browser
Convert Jupyter and Google Colab .ipynb notebooks into clean .py Python scripts in your browser. Zero upload, optional # %% cell markers and magic handling.
Drop your .ipynb file here
or
Converted on this device — never uploaded
Works with .ipynb files from
3 steps
Clean Python extraction without installing nbconvert or uploading proprietary source code.
Drop your .ipynb file into the extractor or click the sample notebook to test the output format.
Toggle # %% cell markers, Markdown comments, and % / ! IPython magic commenting to match your workflow.
Review the generated Python script live, then copy it to your clipboard or download the .py file.
Notebooks are built for interactive exploration, but production jobs, Git pull requests, code reviews, and CI pipelines expect plain .py files. Moving code out of a .ipynb JSON wrapper by hand means copying dozens of cells one by one while avoiding saved HTML tables and base64 image strings. Our ipynb to py converter reads the notebook JSON locally in your browser and extracts every code cell into a clean UTF-8 Python script in milliseconds, without uploading proprietary code to an external server.
Unlike jupyter nbconvert --to script, you do not need Python, Jupyter, Pandoc, or Conda installed on the machine you are using. Every option updates the preview live so you can verify the extracted Python script before copying it or saving the .py file to disk.
# %% cell markers: Adds VS Code, Spyder, and PyCharm scientific cell dividers (# %% and # %% [markdown]) between blocks. That lets you keep running cells interactively inside an IDE after converting, or collapse sections cleanly. Turn this off when you want a minimal flat script for CLI execution or packaging.# comment blocks above the code they explain so section titles and doc notes stay intact. Uncheck this option to strip all prose and keep executable code cells only.% / ! magics: Notebooks exported from Google Colab and Jupyter often contain IPython directives such as %matplotlib inline, %load_ext autoreload, %timeit, or !pip install. Those lines raise SyntaxError in standard python script.py runs. Keeping this option enabled prefixes them with # [notebook magic] so the exported .py file stays syntactically valid out of the box.Plain .py scripts only hold source code and comments, so DataFrames, stdout logs, and PNG/SVG plots are intentionally excluded during extraction. That keeps your .py file lightweight, diff-friendly in Git, and ready to refactor into modules or scheduled batch jobs. Empty cells are automatically skipped to avoid cluttering the output with blank dividers.
The exported script fails with NameError or SyntaxError on a magic command. Make sure Comment out % / ! magics is checked before downloading, and check whether the notebook relied on IPython-only helpers such as display() or get_ipython(), which require either replacing with print() or importing from IPython.display.
My notebook uses older nbformat 3. Both nbformat 4 (cells) and legacy nbformat 3 (worksheets) are supported automatically, so older classroom or archive notebooks extract cleanly.
The notebook contains non-Python code. If a notebook runs an R, Julia, or Bash kernel, the extractor still pulls every code cell cleanly without corrupting indentation, though you should rename the downloaded file extension to match that language.
I need to share results instead of raw code. Python .py files drop all tables, formulas, and charts. If a colleague or instructor needs to see your outputs, use our IPYNB to PDF converter, inspect the notebook in the IPYNB viewer, or export a web page with IPYNB to HTML.
Spotted an edge case? Email contact@ipynbhub.com.
No. The .ipynb JSON is parsed locally inside your browser tab via FileReader, and the .py file is generated in memory with a Blob download. Nothing is uploaded.
Adding # %% markers lets editors like VS Code, PyCharm Professional, and Spyder recognize each original notebook cell as a runnable code block. You can turn them off for a plain script.
Lines starting with % (IPython line magics like %matplotlib inline) or ! (shell commands like !pip install) cause SyntaxError in standard Python. Enabling Comment out % / ! magics prefixes them as safe comments.
Yes. Leave Markdown as comments checked to keep explanations as # comments, or uncheck it to extract code cells only.
Yes. Both modern nbformat 4 notebooks (Colab, JupyterLab, VS Code) and legacy nbformat 3 notebooks are supported.
More tools
Switch between viewing, PDF printing, HTML export, and Python extraction — zero upload across every tool.
Save notebooks as formatted A4 or Letter PDFs with charts and tables intact.
Convert to PDFRead notebooks directly in your browser with wrapped code and a clickable outline.
Open IPYNB viewerExport a self-contained HTML file with styles, tables, math, and plots.
Convert to HTMLTurn your notebook into clean Python.
Free, private, no sign-up. Your .ipynb file never leaves your computer.
Extract a .py script