Tools

snake_case Converter

Turn phrases or camelCase into snake_case

How to convert to snake_case

  1. Paste a phrase, a camelCase or PascalCase name, or a list of names, one per line.
  2. Press the highlighted snake_case button: words become lowercase and are joined with underscores.
  3. Copy the result. A CONSTANT_CASE (upper snake case) button is available too.

Where snake_case is used

snake_case writes words in lowercase separated by underscores: "user first name" becomes user_first_name. It is the official style for variables and functions in Python (PEP 8) and Ruby, the usual style for database tables and columns in PostgreSQL and MySQL, and common for file names and environment configuration. Upper snake case, or CONSTANT_CASE, is used for constants and environment variables such as MAX_RETRIES or DATABASE_URL.

The converter detects word boundaries in camelCase and PascalCase, so getUserID becomes get_user_id, and it treats spaces, hyphens and dots as separators. Punctuation is removed so the output is always a valid identifier. Converting a JavaScript object's keys for a Python or SQL backend is a typical use: paste the key names one per line and copy them all at once.

Nothing is uploaded; conversion happens in your browser.

FAQ

Why does Python use snake_case?

The PEP 8 style guide recommends it for readability, and the community follows it.

How are numbers handled?

Numbers stay attached as words, so "line 2" becomes line_2.

What is screaming snake case?

Another name for CONSTANT_CASE: uppercase words joined with underscores.