Developer utility
snake_case converter
Paste any text below to convert it to snake_case — the default identifier style in Python, Ruby, Rust, and PostgreSQL. Handles camelCase, kebab-case, spaces, and mixed input automatically.
How snake_case works
snake_case joins multiple words into a single identifier using underscores as the separator, with every letter in lowercase. Examples: first_name, get_user_id, is_logged_in, parse_json_payload. The name comes from the low, flat visual rhythm the underscores create — it looks like a snake slithering along the baseline.
The all-uppercase sibling, SCREAMING_SNAKE_CASE (also called CONSTANT_CASE), uses the same separator but is reserved for constants and environment variables: MAX_RETRIES, DATABASE_URL. Mixing the two is a style smell — stick with lowercase snake for values that vary, screaming snake for values that don't.
This tool normalizes the input first — it splits on spaces, existing underscores, hyphens, dots, slashes, and case transitions — then rejoins with underscores and lowercases everything. Paste firstName, first-name, First Name, or FIRST_NAME and you'll get the same output: first_name.
When to use snake_case
snake_case is the right call when your language or data format calls for it:
- Python — PEP 8 mandates snake_case for variables, functions, methods, and module names.
- Ruby — method names, local variables, and symbols all use snake_case by convention.
- Rust — variables, functions, and module names. Types use PascalCase; constants use SCREAMING_SNAKE_CASE.
- PHP — function names in the PSR-12 standard, though class methods often drift toward camelCase.
- PostgreSQL / MySQL — table and column names. Using camelCase in SQL works but requires quoting identifiers in Postgres, which is friction.
- REST APIs — GitHub, Stripe (legacy fields), and most Python/Ruby-origin APIs use snake_case in JSON. Know your API before you guess.
Need the JavaScript-style variant or URL-style variant? camelCase converter and kebab-case converter use the same input parsing. For a deeper comparison of when each is appropriate, see camelCase vs snake_case.
Frequently asked questions
What is snake_case?
A naming convention where words are joined with underscores and every letter is lowercase. Examples: first_name, get_user_id. It is the default identifier convention in Python, Ruby, Rust, and PostgreSQL.
What is the difference between snake_case and SCREAMING_SNAKE_CASE?
Same separator, different case. snake_case is all lowercase (max_retries); SCREAMING_SNAKE_CASE is all uppercase (MAX_RETRIES). By convention snake is for variables, screaming snake for constants and environment variables.
Which languages use snake_case?
Python (PEP 8), Ruby, Rust, PHP, Elixir, and PostgreSQL all use snake_case by default. Many REST APIs from Python or Ruby ecosystems use it in JSON payloads.
Does this tool send my text to a server?
No. Conversion happens entirely in your browser. Nothing you paste leaves your device.