Curious Minds

Clear answers to science and history questions

How to Zoom Out in Jupyter Notebook: Quick Guide

· 5 min read · Science

To zoom out in a Jupyter Notebook, the most reliable method is your browser's zoom control: press Ctrl and - (Windows/Linux) or Cmd and - (Mac) to shrink the entire page, including code cells and output. If you only want to shrink the code font inside cells, use the notebook's own settings or a browser extension. No installation is needed for browser zoom; for code-only zoom, you may need to adjust settings or add a small CSS snippet.

What You'll Need

  • A web browser with Jupyter Notebook open (Chrome, Firefox, Edge, or Safari).
  • Keyboard access for zoom shortcuts (or a mouse with a scroll wheel).
  • Optional: a browser extension such as a zoom controller if you want per-site zoom memory.
  • Optional: edit access to the notebook's custom CSS if you want to change the default code font size.

Step-by-Step

  1. Try the browser zoom shortcut first. Press Ctrl + - (hold Ctrl and tap the minus key) on Windows or Linux, or Cmd + - on Mac. Each press zooms out one step. This shrinks everything: menus, code cells, markdown text, and outputs. It is the fastest fix and works in every browser.
  2. Use the browser menu if shortcuts are awkward. In Chrome or Edge, click the three-dot menu, find Zoom, and click the minus button. In Firefox, open the hamburger menu and use the zoom controls at the top. In Safari, use the View menu and choose Zoom Out.
  3. Reset to 100% when you are done. Press Ctrl + 0 (Windows/Linux) or Cmd + 0 (Mac) to return to the default zoom level. This prevents the notebook from staying tiny the next time you open it.
  4. If you only want smaller code text, adjust the notebook's font settings. In Jupyter Notebook (the classic interface), open the Settings or View menu and look for a font-size or zoom option. In JupyterLab, go to Settings > Theme or Settings > Advanced Settings Editor > Notebook and change the fontSize value. Save and reload the page.
  5. Use a custom CSS snippet for permanent code zoom. If you have file access, create or edit the file ~/.jupyter/custom/custom.css and add a rule such as .CodeMirror pre { font-size: 12px; } or .jp-Notebook .cm-editor { font-size: 12px; } depending on your Jupyter version. Save the file and restart the notebook server. This changes only the code editor font, not the whole page.
  6. Consider a browser extension for site-specific zoom. Extensions like Zoom for Google Chrome or Firefox's built-in per-site zoom let you set a zoom level that applies only to your Jupyter URL. This is useful if you want the notebook smaller but other sites unchanged.
  7. Check that outputs and plots scale correctly. Browser zoom scales images and plots too, which can make them blurry or too small. If plots become unreadable, zoom back in and instead reduce only the code font using the CSS method above.

Common Mistakes

  • Using Ctrl + scroll wheel accidentally. Many browsers zoom with Ctrl + mouse wheel. A stray scroll while holding Ctrl can shrink or enlarge the page unexpectedly. Release Ctrl before scrolling.
  • Confusing browser zoom with notebook font size. Browser zoom affects the entire page, including menus and buttons. If you only want smaller code, change the notebook font setting or CSS, not the browser zoom.
  • Forgetting to reset zoom. A notebook left at 50% zoom will look tiny next time. Use Ctrl + 0 or Cmd + 0 to reset.
  • Editing the wrong CSS file. JupyterLab and classic Jupyter Notebook use different CSS selectors. A rule that works in one may do nothing in the other. Check your Jupyter version before editing.
  • Expecting zoom to persist across browsers. Browser zoom is usually saved per site, but clearing cookies or using private browsing can reset it. Use a per-site extension if you need consistency.

Tips

  • Use Ctrl + + (or Cmd + +) to zoom back in one step at a time.
  • In JupyterLab, the command palette (Ctrl + Shift + C) has a Increase Font Size and Decrease Font Size command that affects the editor only.
  • If you share notebooks, avoid relying on browser zoom for layout; instead, set a readable default font size in the notebook's metadata or CSS so others see the same view.
  • For presentations, use browser full-screen mode (F11) together with zoom to fit more code on screen.

Troubleshooting

  • Shortcuts do nothing: Click inside the notebook page first so the browser window has focus. Some browsers require the cursor to be over the page content, not the address bar.
  • Zoom changes but code stays the same size: You may have a custom CSS rule fixing the font size. Check custom.css or the notebook's theme settings and remove or adjust the rule.
  • Notebook looks broken after zooming: Reset to 100% with Ctrl + 0. If layout is still wrong, clear the browser cache or try a different browser.
  • CSS changes have no effect: Ensure you edited the correct file for your Jupyter version and restarted the server. In JupyterLab, custom CSS may need to be placed in a different location or applied via the Advanced Settings Editor.
  • Zoom resets every time: Your browser may be set to clear site data on exit. Disable that setting or use a per-site zoom extension that stores settings separately.

Frequently Asked Questions

Does zooming out change the notebook file?

No. Browser zoom and font-size settings are display-only. The .ipynb file content is unchanged.

Can I zoom out only the code cells, not the whole page?

Yes, by changing the notebook's font size in settings or by adding a CSS rule that targets the code editor. Browser zoom affects everything.

Why does my notebook look different after zooming?

Browser zoom scales all elements, including plots and tables. Some layouts may wrap differently. Reset to 100% if it becomes hard to read.

Is there a zoom button inside Jupyter Notebook?

Classic Jupyter Notebook has limited built-in zoom; JupyterLab offers font-size commands in the command palette. Most users rely on browser zoom.

Will zoom settings carry over to other notebooks?

Browser zoom is usually saved per site, so all notebooks on the same server share the same zoom level. Font-size CSS changes apply to all notebooks using that configuration.

Can I set a default zoom level for Jupyter?

Not directly in Jupyter itself. Use a browser extension that remembers per-site zoom, or set a smaller default font in the notebook's CSS or settings.

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions