Feet and inches input on iPhone

A real bug we shipped: measurement fields on our calculator site could not be filled in on an iPhone.

Last updated November 30, 2026 · Keyboards checked on real phones: iPhone (iOS 17 and 18), Galaxy S24 and S25, Pixel 9, Motorola Edge 50 Fusion

What happened

We build calculators where people type room sizes the way a tape measure reads: 12' 6", 11 3/4, 10x20. To show a friendly keypad on phones, the length fields had inputmode="decimal". On a real iPhone that opens the decimal pad: ten digits and a point. No apostrophe, no quote mark, no space, no slash, no x. The examples on the page were impossible to type. Desktop tests passed, because a computer keyboard has every key. It took a real phone to see it.

The fix was to remove inputmode from every length field so the standard keyboard opens. Price and percentage fields kept the decimal pad, because they only ever need digits and a point.

Inputs that work for measurements

One field, standard keyboard

<label for="len">Length</label>
<input id="len" type="text" placeholder="12' 6" or 12.5"
       autocapitalize="none" autocorrect="off" spellcheck="false">

Parse feet, inches and fractions yourself. Accept ' and " as well as ft and in, smart quotes (’ ”) that the iPhone keyboard inserts, and fractions such as 1/2 or the single character ½.

Two fields, number pads

<fieldset><legend>Length</legend>
  <label>Feet <input type="text" inputmode="numeric"></label>
  <label>Inches <input type="text" inputmode="decimal"></label>
</fieldset>

Separate feet and inches fields let both use number pads. You lose fractions like 3/8 unless you accept decimals (0.375) or add a fraction picker.

Watch for smart punctuation

With Smart Punctuation on, which is the iPhone default, typing ' and " produces curly ’ and ”. A parser that only looks for straight quotes rejects them. Normalize both before parsing.

Test the placeholder

A good rule: every example in your placeholder or help text must be typeable on the keyboard the field opens. The checker tests exactly that.

It is not only the iPhone

We later checked the same fields on Android phones. The Galaxy and Gboard number pads add a dash, comma and point (Gboard also has a space), but none of them has an apostrophe, a quote mark or a slash. So 12' 6" and 11 3/4 cannot be typed on any phone's number pad. Only the standard keyboard works for measurements written the tape-measure way.

A parser that accepts how people write lengths

InputRead asTotal inches
12' 6"12 ft 6 in150
12’6”smart quotes, same as above150
12 ft 6 inwords150
12.5 ftdecimal feet150
150"inches only150
11 3/4"inches with a fraction11.75
10x20two lengths (a room size)split on x first
function toInches(raw) {
  let s = raw.trim().toLowerCase()
    .replace(/[’‘′]/g, "'").replace(/[”“″]/g, '"')
    .replace(/feet|foot|ft/g, "'").replace(/inches|inch|in/g, '"');
  const frac = t => t.split(/\s+/).reduce((sum, p) => {
    const [a, b] = p.split('/'); return sum + (b ? a / b : +a);
  }, 0);
  const m = s.match(/^(?:([\d.\s/]+)')?\s*(?:([\d.\s/]+)"?)?$/);
  if (!m) return null;
  return (m[1] ? frac(m[1].trim()) * 12 : 0) + (m[2] ? frac(m[2].trim()) : 0);
}

Test it with every example in your own help text before shipping. A number with no unit is ambiguous: decide whether it means feet or inches for that field and say so in the label, for example "Length (feet)".

Frequently asked questions

Can I type a fraction on the iPhone decimal pad?

No. The decimal pad has no slash or space. Use the standard keyboard or accept decimals.

Why does my parser fail on iPhone but not on a computer?

Usually smart quotes: the iPhone turns ' and " into ’ and ”. Convert them before parsing.

Should a bare number mean feet or inches?

Choose per field and say it in the label, such as "Wall height (feet)". Room sizes are usually feet; trim and door gaps are usually inches.

Found a mistake or want a check added? Write to contact (at) mobileformcheck.com.