Renaming a Field Without Breaking the API
By toolbelt maintainers ·
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?
What is a URL slug?
Does it handle non-Latin text?
Does it alter the original?
Related tools
- Hash GeneratorGenerate MD5, SHA-1, SHA-256, SHA-512 and CRC-32 checksums from any text. Everything is computed with the browser crypto API, so nothing you paste is ever sent anywhere.
- Diff CheckerCompare two blocks of text line by line and see exactly what was added or removed. Useful for config files, migrations and reviewing edits before committing.
- QR Code GeneratorTurn any URL or text into a QR code and download it as an SVG. Choose the error-correction level for logos or rough printing, entirely in your browser.
- Markdown PreviewWrite Markdown and see it rendered live, then copy the generated HTML. Supports GitHub-flavoured tables, task lists, code fences and blockquotes.