To snake_case
Convert any text to snake_case: all lowercase separated by underscores. Useful for Python variable names and DB columns.
—
From spreadsheet headers to code identifiers
You get a spreadsheet with headers written for people to read: Date of Birth, Unit Price (R$), Email Address. When it is time to create the database columns or the variables in your Python script, none of that works, because of the spaces, the punctuation, the capitals and, in Brazilian data, the accents. Paste the text here and the result comes out lowercase joined by underscores, live as you type.
The word splitting does more than swap spaces for underscores. Accented characters are decomposed and the marks dropped, so Ação becomes acao and naïve becomes naive. Anything that is not a plain letter or a digit acts as a separator. camelCase is split too: helloWorld becomes hello_world and XMLHttpRequest becomes xml_http_request, keeping the acronym boundary. Digits glued to a word stay: item2price stays item2price.
Check two things before shipping the output. The whole box becomes one identifier, and line breaks count as separators, so pasting twenty headers at once returns a single merged name; do them one at a time. Watch the first character too: 2024 Sales comes out as 2024_sales, which Python rejects as a variable name and SQL only accepts when quoted. It all runs in your browser, and there is no copy button, so select the result.
Frequently asked questions
What happens to accents and the cedilla?
Can I convert a whole list of headers at once?
What if I need UPPER_SNAKE_CASE for constants?
Related Tools
Text Case Converter
Convert text between UPPERCASE, lowercase, Title Case, camelCase and snake_case. Instant result in the browser.
To kebab-case
Convert text to kebab-case: lowercase separated by hyphens. Standard for friendly URLs (slugs), CSS files and HTML attributes.
Text to HTML Entities
Encode special characters as HTML entities (<, >, &) or decode HTML entities back to plain text.