CcConvertCase

Convert camelCase to snake_case โ€“ Free Tool & Code

Published 2026-01-24 ยท convertcase.in

camelCase to snake_case is a common conversion needed when switching between JavaScript (camelCase) and Python (snake_case) codebases or APIs.

Try it now โ€” free instant conversion

No signup ยท No limits ยท Works on all devices

Open ConvertCase โ†’

1camelCase vs snake_case

camelCase: getUserProfile
snake_case: get_user_profile

2In JavaScript

str.replace(/([A-Z])/g, "_$1").toLowerCase()
// "getUserProfile" โ†’ "get_user_profile"

3In Python

import re
re.sub(r'(?<!^)(?=[A-Z])', '_', str).lower()

4Online Tool

Use convertcase.in to paste camelCase text and convert to snake_case without writing any code.

Frequently Asked Questions

Why convert camelCase to snake_case?

Often needed when: a JS frontend sends camelCase to a Python backend that expects snake_case, or when migrating between codebases.

Related Guides

Free CamelCase Converter OnlineFree Snake_case Converter OnlineConvert Case in Python โ€“ Methods & Examples