Skip to content

Main content

JSON Array Hole Vs Null Label Tool

Distinguish an out-of-range JSON array index from an explicit null or present value. JSON arrays cannot encode JavaScript sparse holes.

Loading tool…

Description

Parse arrayJson as a JSON array and validate a nonnegative index.

JSON distinguishes null, strings, numbers, Booleans, arrays, and objects. Parsing a token produces a value whose type can differ from its apparent textual spelling.

Parse arrayJson as a JSON array and validate a nonnegative index.

When to use this tool

Use JSON Array Hole Vs Null Label when you need one bounded JSON value classification or wrapper operation.

How to use the tool and how it works

  1. Enter arrayJson, index. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read status. Use the output convention below.

Parse arrayJson as a JSON array and validate a nonnegative index. Return absent-index beyond its length, explicit-null for literal null, and present-value otherwise.1

Input fieldMeaning and unitsAccepted input
arrayJsonJSON text containing an array; JSON has no sparse array holes.Required. Text; maximum UTF-16 length 8192.
indexPosition under the zero-based or one-based convention stated above.Required. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
statusabsent-index for an index beyond the array; explicit-null for a present null; present-value otherwise.Required. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "arrayJson": "[1,null,3]",
    "index": 1
  },
  "output": {
    "status": "explicit-null"
  }
}

Limitations and assumptions

  • Valid JSON arrays cannot encode sparse JavaScript holes; this compares absence with explicit values and does not inspect an in-memory sparse array.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use a full document parser and the consuming schema when complete validation or exact numeric preservation is required.

References

  1. Calculation and input contract: json/json-array-hole-vs-null-label — tool.io

Similar or alternative tools