snake_case Converter

Lowercase words joined with underscores, like user_first_name.

0 words · 0 characters

Example

Before
User First Name
shippingAddressLine
OrderTotal
After
user_first_name
shipping_address_line
order_total

Where snake_case is used

snake_case is the convention for variables and functions in Python and Ruby, and for table and column names in most SQL databases.

CONSTANT_CASE

Many languages write constants in uppercase snake case, such as MAX_RETRIES. Convert to snake_case here, then run the result through the Uppercase converter.

Why databases like snake_case

Many databases treat unquoted names case-insensitively. PostgreSQL, for example, folds unquoted identifiers to lowercase, so a column created as FirstName is stored as firstname unless you quote it everywhere. Lowercase names with underscores avoid that trap and stay readable, which is why first_name is the most common style for SQL tables and columns.

Language conventions

Python’s style guide (PEP 8) uses snake_case for functions, variables, and modules, and so do Ruby, Rust, and PHP’s standard library. It is also common for file names in Python projects and for environment variable names when written in capitals (DATABASE_URL).

Frequently asked questions

How do I get SCREAMING_SNAKE_CASE?

Convert here, then run the result through the Uppercase converter.

Does it split camelCase input correctly?

Yes. shippingAddressLine becomes shipping_address_line.

What happens to punctuation and accents?

Punctuation counts as a word break and is removed; letters and digits are kept.