Skip to content
uencoder

Snake Case

Snake case joins lowercase words with underscores (e.g., user_name); it is common in Python, database column names, and JSON.

Purpose

Provides a readable multi-word identifier naming style suited to case-insensitive environments.

Mechanism

Lowercase the words and join them with underscores. For example, "UserName" → "user_name". Common for Python, Ruby, SQL, and C function names. Similar to kebab-case (hyphens) but with underscores.

Use cases

  • Python variable and function names
  • Database column names
  • JSON key names
  • C/Rust function names

Examples

  • Input
    UserName
    Output
    user_name

    Joined with underscores

Common errors

Mixing with kebab-case causes inconsistent style
Standardize the naming style across the project

Related terms

Related tools

References