snake_case Converter

Convert text to snake_case instantly for Python variables and database columns — free.

Convert to

About

About the snake_case Converter

Joins words with underscores in lowercase — "user first name" becomes "user_first_name". It's the standard naming convention for variables in Python and Ruby, and for many SQL database column names, where hyphens aren't valid identifier characters anyway.

Every run of non-letter characters becomes a single underscore and every letter is lowercased, so "First Name", "first-name" and "FIRST.NAME" all become "first_name". Apostrophes count as separators too — "customer's id" becomes "customer_s_id" — so remove them first if you don't want the extra word.

Choose what to view about this tool

Guide

Using the snake_case Converter

  1. 1

    Step 1

    Type or paste your text into the input box.

  2. 2

    Step 2

    Click snake_case, or it converts live as you type since this page presets that case.

  3. 3

    Step 3

    Copy the result, or try one of the other case buttons below the input.

  • Builds snake_case as you type from text separated by spaces, hyphens or dots
  • Drops punctuation and symbols, so "Total ($)" becomes "total"
  • Keeps digits, so "address line 2" becomes "address_line_2"
  • Ten other cases are one click away on the same text
  • Copy the result in one click, or Clear to start over
  • Runs entirely in your browser — free, with no sign-up and no limit

Python developers

Developers name variables and functions the way PEP 8 recommends.

Database designers

Designers turn plain-English names into table and column names.

Data analysts

Analysts rename spreadsheet headers one by one before loading them into pandas or SQL.

Ruby developers

Developers name methods and symbols in Ruby's snake_case style.

Convert to another case

Examples

snake_case Converter examples

4 worked examples

01

A form field label

"User First Name" becomes user_first_name — words joined with underscores, all lowercase.

02

A multi-word variable

"Total Invoice Amount Due" becomes total_invoice_amount_due, ready to use as a Python or Ruby variable name.

03

Already hyphenated text

"first-name-field" becomes first_name_field — hyphens convert to underscores too.

04

A Python function name

"Calculate Total Price" converts to calculate_total_price, ready to use as a function name.

FAQ

Frequently asked questions

Quick answers to common questions about the snake_case Converter.

How do I convert text to snake_case?

Type or paste your text above and click snake_case (or just start typing — this page previews snake_case live). Copy the result when you're done.

Is this snake_case converter free?

Yes. It's free, with no sign-up and no limit on how much text you convert.

Where is snake_case used?

snake_case joins words with underscores in lowercase, the standard naming convention for variables in Python and for many SQL column names.

Why can't SQL column names use hyphens like kebab-case?

A hyphen in an unquoted SQL identifier reads as a minus sign, so column and table names use underscores instead — which is exactly why snake_case, not kebab-case, is the SQL convention.

Can I convert to a different case?

Yes — the same tool handles UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase and kebab-case. Click any of the buttons below the input, or use one of the dedicated pages below.

What is SCREAMING_SNAKE_CASE?

It's snake_case in capitals, used for constants and environment variables such as MAX_RETRIES or DATABASE_URL. The same tool has a CONSTANT_CASE button that produces exactly that from any phrase.

Does it split camelCase input like userName?

No — it only splits on spaces and punctuation, so "userName" becomes username rather than user_name. Put a space between the words first, such as "user Name", to get user_name.

What happens to punctuation, accents and numbers?

Punctuation is treated as a separator and removed, digits stay as their own word, and accented Latin letters are kept: "Café menu 2024!" becomes café_menu_2024. Characters from non-Latin scripts are dropped.

Is snake_case the standard in Python?

Yes. Python's PEP 8 style guide recommends snake_case for function and variable names, PascalCase for classes and CONSTANT_CASE for constants. Ruby and Rust use the same convention for functions and variables.

Still have a question? Contact us

Report a problem

snake_case Converter

What went wrong?
    or paste a screenshot