Back to articles

    Code in Presentation Slides: Font Size, Lines and Themes

    November 14, 2026•11 min read•Use Case

    Rules for putting code on slides people can read: minimum font size, max lines and characters, light vs dark themes, 16:9 export and accessible code in docs.

    Picbolt Screenshot Tool

    To make code in presentation slides readable, keep it big and short. Set the code text to at least 1/30 of the slide's height (18 pt on a PowerPoint widescreen slide). Show no more than 10–12 lines of about 60 characters each, and match the code theme to the deck: light for bright rooms and projectors, dark for screens and dim rooms. Documentation works the other way. Use real text in code blocks there, not images.

    What a readable code slide looks like

    • One idea per slide: the function, query or config block you are talking about, not the whole file.
    • Text a person in the back row can read without squinting.
    • Lines that fit without wrapping, with line breaks you chose rather than ones the tool added.
    • A theme that suits the slide background, with comments and punctuation still visible.
    • A way for the audience to get the code afterwards, such as a link or QR code to the repo. Nobody can copy text out of a projected image.

    Image vs live text for code in presentation slides

    You have two ways to get code onto a slide: paste it as text, or insert an image of it.

    Live text is the built-in route and is often enough. Paste the code into a text box in Keynote, PowerPoint or Google Slides and set a monospace font. VS Code copies with syntax colors by default (setting editor.copyWithSyntaxHighlighting), and slide apps often keep those colors on paste. If yours drops them, you still get plain, editable monospace text.

    An image looks the same on every computer and projector because the fonts and colors are baked in. Text boxes depend on the fonts installed on the machine you present from. If a font is missing, the app substitutes another one and your aligned code can shift.

    Use live text if:

    • You will edit the code during or right before the talk.
    • You share the deck afterwards and want people to copy the code out of it.
    • Screen-reader access to the code matters, for example in a recorded or published deck.

    Use an image if:

    • You present from someone else's computer or a conference laptop.
    • You want the same styled look (window frame, background, theme) across many slides.
    • The deck goes out as a PDF or to a platform that mangles fonts.

    In documentation, use text

    For docs, READMEs, wikis and help pages, put code in a fenced code block or your platform's code element. Readers can search, copy, translate and listen to text, and it picks up the site's own highlighting. A code image in docs forces readers to retype it. Save code images for places where text isn't an option: slides, thumbnails and social posts (see how to share code on Twitter and LinkedIn as an image).

    Font size and line limits for code on slides

    These are rules of thumb we worked out from slide geometry. They don't come from a study. They assume a 16:9 slide with the code shown at the size the audience sees it.

    Minimum size: 1/30 of the slide height

    SlideHeightMinimum code size
    1920×1080 pixel slide or image1080 px36 px
    PowerPoint widescreen (13.333 × 7.5 in)540 pt18 pt
    Any other sizeyour slide heightheight ÷ 30

    To find your slide size in Keynote or Google Slides, open the app's document or page setup, then divide the height the same way.

    You can't read a font size off an image on a slide, so use this check instead: 10 lines of code should fill about half the slide's height. That follows from the rule above with normal line spacing of about 1.5 times the font size. If 10 lines fill only a third of the slide, the text is too small for the back of a room.

    Line limit: 10–12 lines

    At the minimum size, each line takes about 1/20 of the slide's height. After a slide title and margins, roughly two thirds of the height is left for code, which fits about 13 lines. Aim for 10–12 at most, and fewer if you can. If the code doesn't fit, split it across two slides, or show only the lines you are talking about and mark the cuts with // ....

    Width limit: about 60 characters

    In most monospace fonts a character is about 0.6 times as wide as the font size. At 36 px on a 1920 px wide slide, that is about 22 px per character, or roughly 89 characters edge to edge. After margins and the code card's padding, about 60 characters per line is a safe maximum.

    Ways to get under it:

    • Indent with 2 spaces instead of 4.
    • Shorten long variable names for the slide, if that doesn't change the meaning.
    • Break long calls and argument lists across lines yourself.
    • Remove imports, logging and error handling that aren't the point of the slide.

    Don't let a tool wrap lines for you. Wrapped code looks like separate statements, and the indentation stops making sense.

    Light vs dark themes

    Match the code theme to the slide background first, then to the room.

    • Projectors and bright rooms: prefer a light theme. A projector can't project black. The darkest it gets is the screen under the room lights, so a dark theme turns dark grey, and low-contrast tokens like comments and punctuation fade into it.
    • Large displays, TVs, dim rooms and recorded talks: dark themes work well and are easier on the eyes in a dark room.
    • Dark code on a light deck: a dark code card on a white slide can work as a deliberate block, but the brightness jump is large. If most of your slides are light, use a light code theme.

    Whatever you pick, check the comments. Many dark themes dim comments on purpose. If a comment carries meaning ("this runs once per request"), say it out loud or put it in the slide text.

    In Picbolt's code image generator, the light themes are Github Light, Xcode Light and Console Light. The rest, including Xcode Dark (the default), Github Dark, VS Code Dark, Dracula and Nord, are dark. If you keep a light and a dark version of the same deck, the Github, Xcode and Console pairs give you matching variants.

    For the font, pick one that clearly separates 0 from O and 1 from l. JetBrains Mono (the default), Source Code Pro and IBM Plex Mono are safe choices. Fira Code is built around ligatures, which can draw != or => as single symbols. That can confuse an audience new to the language.

    Make a 16:9 code snippet for slides

    We make Picbolt. Its code image generator runs in your browser with no install, and your code is rendered locally, not uploaded. Here is the workflow for one slide.

    1. Trim the code to the lines you need, and break any line longer than about 60 characters.
    2. Open the code image generator.
    3. In the Edit tab, under LANGUAGE, pick your language before you paste. Changing the language later replaces your code with a sample in that language.
    4. Click into the code editor on the canvas, select the sample code and paste yours.
    5. Under THEME & FONT STYLE, pick a theme that matches your deck, and pick a font.
    6. Optional: under FRAMES, choose macOS Light or macOS Dark and type the file name into the window title so the audience knows which file they are looking at.
    7. Keep the code flat. Don't move the Tilt joystick or apply a TRANSFORMS preset, because angled text is harder to read from a distance.
    8. Open the BG tab. Pick a color from SOLID COLORS that matches your slide, or choose Transparent under CUSTOM BG so the code card sits directly on your slide.
    9. Click the aspect-ratio button in the top bar and choose 16:9 Youtube Video. At 1x this exports at 1920×1080.
    10. Back in Edit, raise Font size (4–30, default 15) as far as it goes without wrapping your longest line. If a line wraps, shorten it or lower the size.
    11. Adjust Scale and Padding so the code card fills the frame. Leave room at the top if your slide has a title.
    12. In the Settings tab, set Format to PNG and type a FILE NAME, for example the slide number.
    13. Click Save, insert the file into your slide and size it to fill the slide.

    Settings that matter for slides

    SettingUse for slidesWhy
    Aspect ratio16:9 Youtube VideoMatches a 16:9 slide, so nothing is stretched or letterboxed
    FormatPNGKeeps text edges sharp. JPEG compression blurs the edges of thin characters (more in PNG vs JPG vs WebP)
    Quality1x is 1920×1080; 2x (Lifetime) is 3840×21601x matches a 1080p projector exactly. 2x helps on 4K screens or when you zoom in
    Save vs CopySaveCopy puts a PNG on the clipboard at the on-screen canvas size, not 1920×1080
    BrowserAny browser except SafariIn Safari (and on iOS), the download is always PNG data at the on-screen size, not the 1920×1080 export size

    Avoid the Auto ratio for full-slide images. It exports 1080 px wide at 1x, so stretching it across a 1920 px slide makes the text soft.

    What the free plan covers

    Picbolt has a free plan (3 downloads a day) and a one-time Lifetime plan. Code images carry no watermark on either plan. On the free plan, Save and Copy both count toward the 3, exports are 1x, and the format is PNG or JPEG. A 1x 16:9 PNG is 1920×1080, which is enough for most projectors. Lifetime removes the daily limit and adds 2x and higher. The details are in Is Picbolt free?

    What Picbolt's code images don't do

    • No line numbers. There's no toggle. If you need to say "look at line 4," highlight the line instead (next section) or use a tool that shows numbers.
    • No automatic language detection. You pick from 17 languages. Yaml, Vue and Svelte show as plain text without highlighting.
    • No animation. Every export is a still image.

    Highlight the line you're talking about

    Step-through slides show the same code on several slides with a different part highlighted each time. They are easier to follow than one dense slide.

    The built-in way works in any slide app. Duplicate the slide, then draw a semi-transparent rectangle over the lines you want to dim, or a colored outline around the line you are pointing at. It stays editable and costs nothing.

    To bake the highlight into the image instead:

    1. Open Picbolt's Design Canvas and set the aspect ratio to 16:9 Youtube Video.
    2. Paste or drop your exported code image. Raise Size so it fills the canvas.
    3. Select the image layer and click Highlight.
    4. Drag over the lines you want to keep bright. Everything outside the box dims (Background Opacity, default 0.6), and the box gets a blue border.

    On the free plan, Design Canvas exports carry a "Made with Picbolt" watermark, and each version counts toward the daily 3. For other methods, see how to highlight part of an image.

    Other tools for code images

    OptionGood forTrade-off
    Paste as text in your slide appEditable, copyable, accessible codeColors can drop on paste; fonts can change on another computer
    Picbolt code imagesStyled 16:9 images with frames and backgrounds, in the browserNo line numbers; free plan is 3 downloads a day at 1x
    CodeSnap and its forksGrabbing code straight from VS Code; fork listings mention line numbersNeeds VS Code; newer work appears spread across several forks (as of November 2026)
    Chalk.istFree, open-source code images with themes and window stylesMakes code images only (as of November 2026)

    We cover more options, including Carbon and Snappify, in the best code screenshot tools and Snappify alternatives.

    Accessibility for code slides

    • Size comes first. The 1/30 rule above helps everyone, including people with low vision.
    • Add alt text to every code image. Keynote, PowerPoint and Google Slides all let you add a description to an image. Describe what the code does ("A Python function that retries a request three times"), not every character.
    • Put the full code in the speaker notes or on a linked page, so recorded and shared decks still carry the text.
    • Don't rely on color alone. "The red line" means nothing to some color-blind viewers or on a washed-out projector. Refer to code by its content ("the return inside the loop") or with a highlight box.
    • Check contrast on the real screen. Comments, brackets and operators are usually the lowest-contrast tokens in a theme. If you can, test one slide on the actual projector before the talk.
    • Give people the code. End with a link or QR code to the repo or a gist. Picbolt's QR code tool makes one from any URL. Free exports carry the watermark and count toward the daily 3. How to make a QR code for a link covers other ways.

    Common mistakes

    • Pasting a whole file. If you can't raise the font size without lines wrapping, there is too much code on the slide.
    • Letting long lines wrap. Break them yourself.
    • Switching the language after pasting. In Picbolt this replaces your code with a sample, so choose the language first.
    • Using Copy for the final image. Copy gives the on-screen size. Save gives the exact 16:9 pixel size.
    • Exporting from Safari, then finding the image isn't 1920×1080.
    • Saving as JPEG. Use PNG for anything with text.
    • Tilting the code for style. Keep 3D tilt for marketing images, not slides people need to read.
    • Using a dark theme on a bright projector without a test run.

    If your slides also show app screenshots next to the code, how to show product screenshots in a pitch deck covers sizing and framing for those.

    Share this article