Paste code into OneNote with syntax highlighting

Prepare readable code snippets for Microsoft OneNote while keeping syntax colors, spacing, and optional line numbers intact.

How to paste code into OneNote

  1. Paste the source code and select its language.
  2. Copy the highlighted result.
  3. Paste it into a OneNote page beside your explanation.

OneNote code formatting questions

Use line numbers when your class notes, reviews, or troubleshooting steps need stable references.

Start highlighting code · Code to Word · Supported languages