gchq/CyberChef · error · OperationError

Unable to detect the input delimiter automatically.

Error message

Unable to detect the input delimiter automatically.

What it means

Thrown by convertCoordinates when inDelim is 'Auto' and findDelim cannot recognise a delimiter. findDelim only recognises compass-direction splits (N/E/S/W producing 1-3 segments) or one of the literal characters comma, semicolon, colon. If the input uses spaces, tabs, newlines, pipes, or has more than three segments, auto-detection returns null and the error fires.

Source

Thrown at src/core/lib/ConvertCoordinates.mjs:86

        hash,
        utm,
        mgrs,
        osng,
        splitLat,
        splitLong,
        lat,
        lon;

    // Can't have a precision less than 0!
    if (precision < 0) {
        precision = 0;
    }

    if (inDelim === "Auto") {
        // Try to detect a delimiter in the input.
        inDelim = findDelim(input);
        if (inDelim === null) {
            throw new OperationError("Unable to detect the input delimiter automatically.");
        }
    } else if (!inDelim.includes("Direction")) {
        // Convert the delimiter argument value to the actual character
        inDelim = realDelim(inDelim);
    }

    if (inFormat === "Auto") {
        // Try to detect the format of the input data
        inFormat = findFormat(input, inDelim);
        if (inFormat === null) {
            throw new OperationError("Unable to detect the input format automatically.");
        }
    }

    // Convert the output delimiter argument to the real character
    outDelim = realDelim(outDelim);

    if (!NO_CHANGE.includes(inFormat)) {

View on GitHub (pinned to 4290ea7539)

Solutions

  1. Pass an explicit inDelim value (e.g. 'Space', 'Comma') instead of 'Auto'.
  2. Reformat the input to use a recognised delimiter (comma, semicolon, or colon).
  3. Pre-trim and normalise whitespace, or convert delimiters before calling convertCoordinates.

Example fix

// before
convertCoordinates("51.5074 -0.1278", "Auto", ...); // space not auto-detected

// after
convertCoordinates("51.5074 -0.1278", "Space", ...);
Defensive patterns

Strategy: validation

Validate before calling

import { findDelim } from ".../ConvertCoordinates.mjs";
if (inDelim === "Auto" && findDelim(input) === null) {
  throw new Error("No delimiter detected; pass an explicit inDelim (e.g. 'Comma', 'Space').");
}
convertCoordinates(input, inFormat, inDelim, outFormat, outDelim, includeDir, precision);

Try / catch

try {
  convertCoordinates(input, inFormat, "Auto", outFormat, outDelim, includeDir, precision);
} catch (e) {
  if (/delimiter/i.test(e.message)) {
    // retry with an explicit delimiter based on known data shape
    convertCoordinates(input, inFormat, guessDelim(input), outFormat, outDelim, includeDir, precision);
  } else throw e;
}

Prevention

When it happens

Trigger: convertCoordinates called with inDelim='Auto' on input delimited by whitespace, a pipe '|', an en-dash, or any character outside {',', ';', ':'} that also contains no compass letters. Also fires when the input has more than 3 segments after splitting on a found delimiter.

Common situations: Pasting coordinates copied from a source that uses spaces or tabs between lat and lon; data exported as TSV; mixing multiple delimiters; input already pre-split into more than two values.

Related errors


AI-assisted analysis of gchq/CyberChef@4290ea7539 (2026-08-13). Data as JSON: /api/errors/4dc2c2b68454fe0c. Report an issue: GitHub.