Online Dev Tools

Developer & Security Tools for IT Professionals

Fuel The Infrastructure
Blog

camelCase, snake_case, kebab-case: Naming Conventions and When to Convert


Naming looks like a style preference until data crosses a boundary — a JSON API into a Python backend, a database column into a JavaScript object, a CSS class into a component prop. Each side has a preferred casing, and the seams between them are a reliable source of "undefined is not a function." Knowing the conventions (and converting deliberately) saves a surprising amount of debugging.

The common cases

The Case Converter transforms text between all of these, which is handy when you are, say, turning a list of database columns into camelCase object keys or a heading into a URL slug.

Where the boundaries bite

The bugs almost always appear at a translation point:

Convert deliberately, not by hand

Hand-editing casing across a long list is exactly the kind of tedious task that introduces typos — a missed capital, an underscore where a hyphen belongs. Two habits help:

  1. Batch-convert a column list or a set of keys with the Case Converter rather than editing each by hand.
  2. Normalize a list — dedupe and sort field names before converting — with the Line Sorter, so you are not converting the same key twice or missing one.

When you are mapping a payload's fields, the JSON Formatter makes it easy to read both sides side by side and confirm every key lines up after conversion.

A tiny checklist

When data crosses a boundary, ask:

The short version

Casing is a dialect, and every ecosystem speaks its own. The trouble is not any single convention — it is the untranslated boundary between two of them. Pick the right case for each context (kebab for URLs and CSS, snake for Python and SQL, camel for JS and JSON), and convert in bulk with the Case Converter instead of trusting your fingers.

Sources

  1. This article is original editorial content published by Online Dev Tools.

Related tools