What Is CONSTANT_CASE? A Guide to Uppercase Naming for Constants

3 min read

CONSTANT_CASE is identical to SCREAMING_SNAKE_CASE: all uppercase letters separated by underscores. It signals that a value is a constant — set once, never changed.

Why Use a Special Case for Constants?

Constants stand out visually when they're all caps. When you see MAX_CONNECTIONS in code, you instantly know it's a fixed value — no need to trace where it's assigned or whether it changes.

Examples by Language

// JavaScript
const API_TIMEOUT = 5000;

# Python
DATABASE_URL = "postgres://..."

// Java
public static final int MAX_RETRIES = 3;

// Rust
const MAX_THREADS: u32 = 8;

Convert to CONSTANT_CASE

Use our constant case converter or the case converter hub.