TextyConverterbeta
⌘K

snake_case Converter

Convert any string to snake_case — lowercase words joined by underscores. Common in Python, Ruby, and SQL.

0 characters
0 characters

About snake_case Converter

snake_case is the standard identifier convention in Python, Ruby, Rust, and most SQL dialects. Words are lowercased and joined with underscores. This converter accepts input from any common shape — spaces, hyphens, camelCase, PascalCase, dots, slashes — and emits clean snake_case.

When to use it

  • Generating database column names from a glossary or domain model
  • Producing Python variable names from human-readable labels
  • Converting camelCase JSON keys to Python-friendly snake_case
  • Normalizing identifier conventions across a multi-language codebase

How it works

The input is split into words by recognising whitespace, hyphens, underscores, dots, slashes, camelCase transitions, acronym boundaries, and letter-to-digit boundaries. Each word is lowercased and the words are joined with an underscore.

Examples

User Profile Page
user_profile_page
camelCase → snake_case
createdAt
created_at
HTMLParserError
html_parser_error

Frequently asked questions

How are leading or trailing separators handled?
They're dropped. The output has no leading or trailing underscores; only single underscores between words.
What about uppercase output?
If you want UPPER_SNAKE_CASE (used for constants), use the CONSTANT_CASE converter instead.
Are digits separated from letters?
Yes — 'item2name' becomes 'item_2_name'. This matches how most case-conversion libraries (lodash, Ruby's ActiveSupport) behave.

Related tools