# Syntax Highlighting

> Each part of the code gets its own colour, so it is easy to read.

**Field:** Software Development  
**Category:** Editors & Tools  
**Also known as:** Code Highlighting

## Think of it like

Think of it like colouring a map. Roads are red, rivers are blue, and you see the shape at a glance.

## Definition

Syntax highlighting shows each part of the code in its own colour. Keywords might be purple, strings green and comments grey. The colours do not change what the code does; they only help you read it. A missing quote often shows up at once, because the rest of the line turns the wrong colour. Almost every code editor does this.

## Example

Jack forgets to close a quote. Every line after it turns green like a string, and he spots the slip in a second.

## Why it matters

Colours let your eyes find the parts of a line without reading every word. Many small slips show up as odd colours.

## Common mistake

Thinking the colours are saved in the file. The file is plain text; the editor paints it each time.

## Three principles

- **Colour by part.** Keywords, strings and comments each get one.
- **Only for reading.** Colours never change what the code does.
- **Shows slips.** A wrong colour points at a typo.

## Related terms

- [Code Editor](https://learn.benibix.com/term/development/code-editor)
- [Keyword](https://learn.benibix.com/term/development/keyword)
- [Syntax](https://learn.benibix.com/term/development/syntax)
- [Comment](https://learn.benibix.com/term/development/comment)

## Taught in

- [Autocomplete and Extensions](https://learn.benibix.com/learn/development-tools/autocomplete-and-extensions): Coding Tools, 2/13

---

Source: https://learn.benibix.com/term/development/syntax-highlighting
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
