Camel Case to Snake Case Converter

Turn 'camelCase' identifiers into 'snake_case' instantly.

Free camelCase to snake_case converter for developers. Paste camelCase or PascalCase identifiers and get snake_case output instantly. Runs entirely in your browser — nothing is uploaded. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is snake_case?

Snake_case writes compound words in lowercase separated by underscores, like 'my_variable_name'. It is common in Python, Ruby and database column names.

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 _.

Conversion examples

InputWords detectedOutput
myVariableNamemy · variable · namemy_variable_name
MyClassNamemy · class · namemy_class_name
parseHTMLStringparse · html · stringparse_html_string
getUserID2get · user · id2get_user_id2
isActiveis · activeis_active
APIResponseCodeapi · response · codeapi_response_code

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

When you need this

Porting Python from JavaScript — JavaScript conventionally uses camelCase for variables and methods; Python uses snake_case everywhere. When you copy a function signature across, every argument name and local variable needs converting.

Writing database migrations — Many ORM frameworks in Python (SQLAlchemy, Django) store column names as snake_case. Renaming a column from a camelCase JavaScript model to match database convention is a frequent need.

Normalising config keys — Config files in YAML or TOML often expect snake_case keys, but code generators or JSON exports produce camelCase. Pasting the whole key list and converting saves error-prone manual renaming.

Rust identifier style — Rust’s compiler enforces snake_case for variables and function names and will warn on camelCase. Converting function names copied from a camelCase codebase stops those linter warnings before you commit.

Common pitfalls

  • Double underscores — If the input has multiple consecutive non-alphanumeric characters (e.g. my__var), they collapse to a single _ in the output.
  • Leading or trailing separators — A name starting or ending with an underscore after conversion is usually a sign the input had an unusual prefix or suffix; check the result before pasting.
  • Numbers — Digits are treated as part of the preceding word unless a non-alphanumeric character separates them, so userId1 becomes user_id1, not user_id_1.

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