Skip to content
toolbelt
Back to Guides

Renaming a Field Without Breaking the API

By ·

Updated

The frontend wants camelCase, the API returns snake_case, and somewhere in between a key silently becomes undefined.

What is this tool?

Casing conventions differ by language and community. Converting between them is trivial until you hit acronyms and existing identifiers.

How it works

I split your input into words first — inserting a boundary before each capital letter, treating underscores, hyphens and dots as separators — then rejoin them in the style you pick. Splitting first is what makes userProfile convert cleanly instead of becoming userprofile.

Example

user profile settings

camelCase     userProfileSettings
snake_case    user_profile_settings
kebab-case    user-profile-settings
Title Case    User Profile Settings

When to use it

Mapping an API response into a frontend model. Renaming a CSS class. Generating a slug from a title.

Optimization Tips

Acronyms do not survive a round trip. XMLParser becomes xml_parser and back to XmlParser. Check any identifier containing two capitals in a row before you rename in bulk.

Frequently Asked Questions

Why did my acronym change?
Splitting lowercases everything, so HTTP becomes http. Rename manually if your codebase keeps acronyms capitalised.
What is a URL slug?
Lowercase words joined by hyphens. It is a readable URL segment, and hyphens are treated as word separators by search engines.
Does it handle non-Latin text?
Word splitting follows the browser’s Unicode rules. Most scripts work; CJK may need explicit separators.
Does it alter the original?
No. The input stays as you typed it.

Ready to try it out?

Put this knowledge into practice with our free tool.

Go to Tool

Related tools