Camel Case to Snake Case Converter

Turn 'camelCase' identifiers into 'snake_case' instantly.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

This converter turns camelCase or PascalCase identifiers into snake_case — the naming style used in Python, Ruby, Rust and SQL column names. Paste a name like myVariableName and get my_variable_name instantly. It is built for developers porting variable names between languages, renaming database columns, or normalising config keys, and it runs entirely in your browser.

How it works

The tool finds the word boundaries inside the identifier, lowercases each word, and joins them with underscores. It inserts a split in two places: between a lowercase or digit followed by an uppercase letter (a → B), and between a run of capitals and a following capitalised word, so acronyms stay intact. It then also splits on any non-alphanumeric separator. Each resulting word is lowercased and the pieces are joined with _.

Example

InputWords detectedOutput
myVariableNamemy · variable · namemy_variable_name
MyClassNamemy · class · namemy_class_name
parseHTMLStringparse · html · stringparse_html_string
getUserID2get · user · id2get_user_id2

So parseHTMLString becomes parse_html_string, with the HTML acronym handled correctly rather than split letter by letter.

Everything runs in your browser, so your code never leaves your machine.

Ad placeholder (rectangle)