format : String



Define and assert semantic information about a string instance.

Kind Annotation Assertion
Applies To String
Dialect 2020-12
Introduced In Draft 1
Vocabulary Format Assertion
Also see


This keyword produces the format name as the annotation value.

Defined Formats

Format Category Specification
"date-time" Time
"date" Time
"time" Time
"duration" Time
"email" Emails
"idn-email" Emails
"hostname" Hostnames
"idn-hostname" Hostnames
"ipv4" IP Addresses
"ipv6" IP Addresses
"uri" Resource Identifiers
"uri-reference" Resource Identifiers
"iri" Resource Identifiers
"iri-reference" Resource Identifiers
"uuid" Resource Identifiers
"uri-template" Resource Identifiers
"json-pointer" JSON Pointer
"relative-json-pointer" JSON Pointer
"regex" Regular Expressions


The format keyword of the “format-assertion” vocabulary allows for basic semantic identification of certain kinds of string values that are commonly used. It provides a way to specify logical formats for string types, such as dates, email addresses, URIs, etc. However, it’s important to note that this vocabulary is not used by default in the official 2020-12 dialect of JSON Schema. If you want to utilize it, you would need to define your own custom dialect that includes this vocabulary.

While the format keyword theoretically provides interoperable logical string type validation, many existing implementations may not support this vocabulary. Therefore, it’s recommended to use the format keyword from the Format Annotation vocabulary (which is available out of the box) alongside any custom validation within the schema.


Custom meta-schema including the 'Format Assertion' vocabulary Schema
  "$schema": "",
  "$id": "",
  "$vocabulary": {
    "": true,
    "": true
  "allOf": [
    { "$ref": "" },
    { "$ref": "" }
Schema with '$schema' set to custom meta-schema Schema
  "$schema": "",
  "$id": "",
  "format": "email"
A string instance with correct email format is valid Instance
A string instance with incorrect email format is also valid Instance
'format' keyword is irrelevant for instances with values other than strings Instance
  // ...
    "valid": true,
    "keywordLocation": "/format",
    "instanceLocation": "",
    "annotation": "email"
  // ...