Description
Parse and decode slash-delimited tokens, replacing ~1 with slash and ~0 with tilde after validating escapes.
JSON Pointer separates path tokens with slashes and escapes literal slash and tilde inside member names. The empty pointer denotes the document root; an empty token can name an actual empty-string member.
Parse and decode slash-delimited tokens, replacing ~1 with slash and ~0 with tilde after validating escapes.
When to use this tool
Use JSON Pointer Common Prefix Length when you need a pointer token, depth, or representation check.
How to use the tool and how it works
- Enter firstPointer, secondPointer. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read commonSegments. Use the output convention below.
Parse and decode slash-delimited tokens, replacing ~1 with slash and ~0 with tilde after validating escapes. Count equal leading decoded tokens across both pointers.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| firstPointer | First Pointer | Required. Text; maximum UTF-16 length 8192. |
| secondPointer | Second Pointer | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| commonSegments | Common Segments | Required. Safe integer. |
{
"input": {
"firstPointer": "/a/b",
"secondPointer": "/a/c"
},
"output": {
"commonSegments": 1
}
} Limitations and assumptions
- The result counts whole segments, not matching characters or a common existing document ancestor.
- 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.
Alternative or Complementary methods
Use a complete pointer parser and resolve against the actual document when existence or array access matters.
References
Similar or alternative tools
- JSON Pointer Terminal Empty Segment
Count slash-separated tokens and mark terminalEmpty for a trailing slash.
- JSON Patch Move Prefix Conflict
Mark same for identical strings and conflict when a distinct path is beneath from by a slash boundary, including root ancestry.