Back
Asciify Logo
Asciify

Colon

: (Colon) is ASCII code point 58 (0x3A), Unicode U+003A, and a printable punctuation character. It introduces what follows from what precedes — a list, an explanation, a revelation — acting as a grammatical drumroll that says "here's what I mean." Programming relies on the colon in wildly divergent ways. Python uses it to open every block — if, for, def, class — making it the character that most often triggers an IndentationError on the next line when something goes wrong. JSON and JavaScript object literals use : to bind keys to values ({"name": "Alice"}). In URLs, it separates the scheme from the authority (https://) and the host from the port number (localhost:8080). C and C++ deploy it in the ternary operator (condition ? a : b), label definitions, and scope resolution (std::vector). The trap lurks in YAML, a format that treats the colon as its key-value separator: a string like title: Mission: Impossible splits at the first colon, making the value just "Mission" and leaving the parser confused about what "Impossible" is doing there. Quoting the value fixes it, but YAML's eagerness to interpret bare strings catches everyone at least once. The mark dates to antiquity, where Greek and Latin scribes placed a raised dot between clauses to indicate a pause longer than a comma but shorter than a full stop. UTF-8 encodes it as a single byte 0x3A. Unicode classifies it as Po (Punctuation, Other) with the name COLON. The visually similar ratio symbol ∶ (U+2236) is technically a math operator, and the modifier letter triangular colon ː (U+02D0) from phonetics is a different character entirely — neither will function where a parser expects ASCII 0x3A.

Punctuation

Technical Details

Code Example

</>
const char *addr = "example.com:443";
const char *p = strchr(addr, ':'); // find host:port delimiter
int port = p ? atoi(p + 1) : 0; // parse port after ':'

Frequently Asked Questions

  • The colon inherited its natural language role ('what follows explains what came before') into computing. It separates keys from values (JSON), labels from statements (C goto), type annotations (TypeScript: string), namespaces (std::cout), and drive letters from paths (C:\).

  • In C++, :: is the scope resolution operator (std::vector, MyClass::method). In Rust, it accesses associated functions (String::new()). In PHP, it accesses static members. In CSS, :: prefixes pseudo-elements (::before, ::after), distinguishing them from pseudo-classes (:hover).

  • The colon separates the scheme from the rest (https:, mailto:, file:). It also separates host from port (localhost:3000). In IPv6 addresses, colons separate address groups ([::1]). These different uses within the same URL format are parsed positionally by RFC 3986.

  • Python uses : to start code blocks (if x:, for i:, def f():) — it replaces the { of C-like languages and was chosen for readability. YAML uses : for key-value pairs (key: value) because it's visually clean and unambiguous. Both choices prioritize human readability.

@workani&@alexluthor
Privacy & legal

Privacy

No accounts, no ads, no tracking cookies, and no cross-site tracking. The only analytics we keep are faceless — anonymous, aggregated counts of pages and searches, never tied to you. We store no IP addresses, set no tracking cookies, and build no profiles. Cloudflare hosts the site and handles requests for delivery and security.

Full privacy policy·Extension privacy·legal@asciify.dev

Attributions & licenses

Twemoji
© Twitter, Inc and other contributors · CC-BY 4.0
Noto Color Emoji
© Google · Apache 2.0
Fluent UI Emoji
© Microsoft · MIT
OpenMoji
© HfG Schwäbisch Gmünd · CC-BY-SA 4.0
Toss Face
© Viva Republica (Toss) · SIL OFL 1.1
JoyPixels
© JoyPixels Inc. · Free Limited Use License
SerenityOS Emoji
© The SerenityOS Developers · BSD-2-Clause
EmojiTwo
© EmojiTwo contributors · CC-BY 4.0
Apple Color Emoji
© Apple, Inc.
Facebook Emoji
© Meta Platforms, Inc.

Apple and Facebook emoji styles are proprietary and shown here solely for reference and comparison — a common-sense application of nominative-use / fair-use principles. asciify is not affiliated with, endorsed by, or sponsored by Apple, Inc., Meta Platforms, Inc., or any other rights holder listed above. If a rights holder requests removal of their emoji style from this site, it will be removed.

All other vendor emoji are reproduced for reference and comparison under their respective open licenses listed above.

Character names and code points from the Unicode® Standard. Unicode® and the Unicode Logo are registered trademarks of Unicode, Inc.

Privacy
© asciify.dev 2025-2026