Jupyter notebook viewer: read an .ipynb without Jupyter
Someone sent you an .ipynb and you have no Python, no Jupyter, or only a phone? Drop it here. You see the notebook as it was saved: Markdown and maths, highlighted code with each cell’s In [n], and the charts, pandas tables, printed text and errors it produced. No code is run.
The file is read by this tab only. It is not uploaded, and nothing in it is executed.
What it shows
- A summary first: the kernel and language, the nbformat version, how many code, Markdown and raw cells, how many cells have outputs, and the five largest outputs by size, each linked to its cell.
- Whether the cells were run out of order. If
In [7]sits aboveIn [6], the outputs you see came from a different order than top to bottom, and re-running the notebook may not reproduce them. The page says where, and which execution numbers are missing. - Markdown cells rendered: headings, lists, tables, links, code blocks and pictures attached to the notebook. Maths written as
$…$,$$…$$or\begin{equation}is typeset by KaTeX, an MIT-licensed typesetter served from this site. - Code cells with syntax highlighting for Python, R, Julia, JavaScript and SQL kernels, and the execution count Jupyter showed beside each.
- The saved outputs: printed text, results, PNG, JPEG and SVG charts (matplotlib, seaborn), pandas DataFrames as tables, LaTeX results, and error tracebacks in their original terminal colours.
- Three saves: the whole notebook as one HTML file that opens in any browser; the code as a .py (or .r, .jl) with a
# %%marker before each cell and the Markdown as comments; and every chart as a PNG.
What this cannot do
- It does not run code and cannot re-run cells. What you see is what was saved; a notebook saved with “Clear all outputs” shows code and Markdown only.
- It does not show live widgets or JavaScript charts. ipywidgets, Plotly, Bokeh and Altair outputs need JavaScript and a kernel. Each one is named in a sentence where it would be, and a static picture saved beside it, if any, is shown.
- It does not edit. Nothing is saved back into the .ipynb.
- HTML written inside Markdown cells appears as text, and pictures linked from the web are not loaded but named, so opening a notebook never contacts anyone.
Useful to know about .ipynb files
- What is inside an .ipynb
- Plain JSON. A
cellslist holds every cell’s source as text; each code cell keeps itsexecution_countand anoutputslist, where a chart is a base64 PNG (about a third larger than the picture) and a pandas table is bothtext/htmlandtext/plain.metadata.kernelspecnames the kernel, andnbformat4 has been the layout since IPython 3 (2015). The older nbformat 3 put cells insideworksheetsand had separate heading cells; this page reads both. - A worked example
- The BSD-licensed test notebook
test4.ipynbfrom the nbformat project reads as: nbformat 4.0, no kernel recorded, 9 cells (4 code, 5 Markdown), 4 with outputs. Its code cells ran as In [1], In [3], In [7], In [6], so it is flagged as run out of order, with numbers 2, 4 and 5 missing. Its largest output is a 12.2 KB PNG (a 520 × 67 logo); a%%javascriptcell’s output is named and not run, and the<script>inside its HTML output is removed. - Why a notebook is huge
- Almost always the outputs, not the code. Every inline chart is stored as base64 text, a printed DataFrame keeps both its HTML and its text form, and some libraries embed their whole JavaScript bundle (several MB) in one output. The “Largest outputs” table shows where the bytes are; clearing those outputs in Jupyter before sharing or committing to git shrinks the file.
- The .py download
- Each code cell follows a
# %% In [n]line, the “percent” cell format that VS Code, Spyder and Jupytext understand, so the file still runs cell by cell. Lines starting with%(IPython magics such as%matplotlib inline) or!(shell commands) are commented out, because plain Python cannot run them; a whole%%bashor%%timecell is commented out too. - Without uploading it
- nbviewer shows only notebooks at a public web address, and GitHub only notebooks pushed to a repository. Here a private notebook, with its data in the outputs, stays on your computer. The HTML outputs are cleaned and drawn in a sandboxed frame that is not allowed to run scripts or load anything; the page checks after drawing that no notebook code ran.