Code snippet for slides with syntax highlighting
Paste your code, pick a theme, and the tool highlights it and sizes the text to fill a slide. Download a PNG or copy it, then paste it into Google Slides, PowerPoint or Keynote.
Everything runs in your browser. Your text and files stay on your device and are never uploaded.
Slide preview
// Debounce a functionfunction debounce(fn, wait = 200) { let timer return (...args) => { clearTimeout(timer) timer = setTimeout(() => fn(...args), wait) }} const onType = debounce((text) => { console.log('Searching for', text)}, 300)
Font size 52px on a 1920 x 1080 image, 12 lines, longest 47 characters, JavaScript.
How to use it
- Paste your code into the box, or open a code file. The language is detected for you, and indentation every line shares is removed so the code starts at the left edge.
- Pick a theme. Light themes read best on projectors, dark themes match dark decks.
- Choose a slide shape, and turn on line numbers or highlight the lines you will talk about, like 2, 4-6.
- Check the preview. If it warns that the text is too small or cut off, shorten long lines or split the code across two slides.
- Click Download PNG or Copy image, then insert or paste it into your slide.
Make code readable from the back of the room
Code on a slide fails for three reasons: the text is too small, there is too much of it, or the colors fight the background. The formatter fixes the first by growing the text until the longest line just fits, and flags the second when it cannot get above a readable size. Aim for 15 lines or fewer, and under 60 characters per line.
| Projector or bright room | Use the Light or Print theme. Dark themes wash out. |
|---|---|
| Dark slide deck | Use Night or Purple dark so the code block matches the slide. |
| Walking through code | Highlight the lines you are explaining. The rest dims. |
| Printed handout | Use Print (black and white) so it reads on any printer. |
Questions
How do I put a code snippet on a Google Slides slide?
Download the PNG, then in Slides choose Insert, Image, Upload from computer. Or click Copy image here and paste straight onto the slide. Resize it to fill the slide.
Can I paste the code as editable text instead of an image?
Yes. Copy as styled text keeps the colors and a monospace font, so you can paste it into Slides or Docs and edit it. Slides may not keep the dark background, so an image is safer for dark themes.
Which languages are supported?
JavaScript, TypeScript, Python, Java, C, C++, C#, Go, Rust, Swift, Kotlin, PHP, Ruby, SQL, shell, HTML, CSS, JSON and YAML. Anything else works as plain text.
How many lines of code fit on one slide?
About 10 to 15 lines at a size the back row can read, with lines under 60 characters. The preview tells you the font size it ended up with and warns when it drops too low.
Is my code uploaded anywhere?
No. The highlighting and the image are made in your browser, so code from a private project never leaves your device.
Which theme works best on a projector?
The Light and Print themes. Projectors wash out dark backgrounds and subtle colors. High contrast is the other safe choice in a bright room.