Convert camelCase to snake_case
Moving identifiers from JavaScript to Python, or from a JSON API into a database schema, usually means converting camelCase to snake_case. This converter splits each identifier at its capital-letter boundaries — including acronym runs like HTTPServer — and re-joins the words with underscores.
userName createdAt HTTPServerError isActive
user_name created_at http_server_error is_active
Try it with your own data
How to convert camelCase to snake_case
- Split the identifier at each lowercase-to-uppercase boundary (userName → user, Name).
- Keep acronym runs together (HTTPServer → HTTP, Server).
- Lowercase every word and join them with underscores.
Frequently asked questions
How are acronyms like HTTPError handled?
A run of capitals is treated as one word until the final capital that starts a new word: HTTPServerError becomes http_server_error, not h_t_t_p_server_error.
Why do Python and databases prefer snake_case?
PEP 8 mandates snake_case for Python variables and functions, and most SQL conventions use it because identifiers are case-insensitive in many databases — underscores keep word boundaries readable.
How does the converter know where words start and end?
It splits on separators (underscores, hyphens, spaces) and on lowercase-to-uppercase boundaries, keeping acronym runs together — so HTTPServerError splits into HTTP, Server, Error regardless of the input convention.
Can I convert many identifiers at once?
Yes — put one identifier or phrase per line and every output format converts the whole list, ready to copy as a block.