Quick answer: try a monospace font for code
To show code in PowerPoint, select the text containing the code and try a monospace font as a practical starting point. This is a way to present code on a slide; by itself, it does not guarantee readability. Check how the characters, line breaks, and indentation look in the font you choose.
You do not have to change the font for the entire presentation. You can format the code separately and leave headings and explanations in your existing design. Rather than choosing a font based on its name, decide by examining the characters and text from your own code on the slide.
What to look for when choosing a font
Check characters that look alike. If they appear in your code, compare 0 and O, 1 and l, or a hyphen and an underscore (- and _) side by side. If you can tell them apart easily in the font you choose, you may want to use it. A monospace font does not necessarily make similar characters look different.
Try Turkish characters. If you will include Turkish explanations or comments alongside the code, also check the letters ç, ğ, ı, İ, ö, ş, and ü in sample text. Trying the text you will actually use in your presentation may be a more useful way to choose than looking only at the font’s name.
Consider size and space together. If the code does not fit on the slide, instead of making the text very small, try shortening the example, setting aside more space, or splitting the content across several slides. Make your final decision by looking at how the code appears in the presentation. For more suggestions about font size, see our guide How to choose a PowerPoint font size.
Apply the font only to the code
Select the code text and choose an option from the Font list on the Home tab. Microsoft’s guidance on using third-party fonts in PowerPoint also explains how to select specific text and choose a font through Home > Font. If the menu names look different in your app, check the font list in the version of PowerPoint you are using.
This process formats the text you selected. Changing the default font for the entire presentation is a separate operation and is not necessary if you only want to show code. According to Microsoft’s guidance on changing the default font in PowerPoint, this setting is available under View > Slide Master; changes affect slides that use the relevant master slide. So, for code, first try selecting and formatting only the code text.
If the font is not in the list
If your chosen font does not appear in PowerPoint’s font list, you can try another available option or consider installing a font. Microsoft’s guide to third-party fonts provides separate steps for Windows and macOS. According to the guide, on Windows you download the font file and install it using Install; on macOS, you open the font in Finder and use Install Font in the preview window. After installation, check whether the font appears in PowerPoint’s list. If PowerPoint was open during installation, Microsoft recommends closing and reopening the app.
When obtaining third-party fonts, keep in mind the risk Microsoft points out: users are responsible for downloading and using these fonts. If you do not want to install a font, try one of the options already available in your app and check how the code looks.
Example: a code slide that performs validation
Hypothetical example: A team is showing in a presentation how a simple JavaScript function responds when there is no name input. This example is not associated with a particular product or project.
Slide title: “Validate input before using it”
Code area:
function greet(name) { if (!name) return "Hello!"; return "Hello, " + name; }
Caption: “If there is no name input, a default greeting is returned.”
First, add the code to a text box and preserve the line breaks and indentation. Then select the code text and apply the monospace font you want to try. You can leave the title and caption in your presentation’s existing font. Open the slide in presentation view and check the quotation marks, curly braces, indentation, and whether any lines are cut off. If space is tight, try shortening the caption, setting aside more room for the code, or splitting up the example; check the appearance again after making changes.
Check the appearance before presenting
If you will show the presentation on another device, check it in presentation view on that device as well, if possible. See whether the font you selected is available in its font list and how the code looks there; do not assume that the preview on your own device will show exactly how it will appear on the other device. If you will use a different output format, such as PDF, open the output you created and check the lines and characters as well. These are practical checks for spotting differences in appearance; they do not guarantee that it will look the same on every device or in every output format.
If the appearance is not what you expected, check which fonts are available on the target device and try an alternative. If you change the font, check the code again. If you do not want the formatting of other parts of the presentation to change, select only the code text while editing. For related suggestions, see our guide PowerPoint font unavailable: troubleshooting steps.
Final checklist
- Did you select all the code text and apply the font you want?
- Do similar characters and, if present, Turkish letters look clear?
- Are line breaks, indentation, and punctuation preserved?
- Does the code fit in the slide area and remain easy to read in presentation view?
- If you will use the presentation on another device or in a different output format, have you checked its final appearance there?
- If you made changes after your final check, have you reviewed the appearance again?
Frequently asked questions
Should I apply the code font to the entire presentation?
No, not if you only want to format the code; you can select the code text and apply the font to that text. Changing the presentation’s default font is a different setting and affects slides that use the master slide. So, instead of applying it to the entire presentation, format the code area separately first.
Will the code look the same on another computer?
Open it on the target device and check. See whether the font is available in that device’s list and check the final appearance of the code. If it looks different, try an available font and check the code again; do not assume it will look the same without checking.
← Back to blog


