Skip to main content
XMLDir

Search 261 pages — tools, formats, elements, namespaces, XPath, datatypes, glossary, parse errors, schema errors, use cases, blog and product.

XSD datatype

xs:unsignedInt

An unsigned 32-bit integer: 0 to 4,294,967,295.

The unsigned family — unsignedLong, unsignedInt, unsignedShort, unsignedByte — mirrors the signed one with a lower bound of zero and correspondingly higher maxima.

xs:unsignedByte is 0–255, which makes it the natural type for a value that must fit in an octet.

Lexical space
Optional plus sign, then digits, within 0 to 4294967295.
Derives from
xs:unsignedLong
Category
Numeric types
Facets
minInclusive, maxInclusive, minExclusive, maxExclusive, pattern, enumeration, whiteSpace, totalDigits, fractionDigits

What validates

Every literal below is put through the schema validator on each test run, against the schema at the foot of this page.

  • 0
  • 4294967295
  • +1

What does not

  • -1

    Unsigned types exclude negatives.

  • 4294967296

    One past the 32-bit unsigned maximum.

What catches people out

  • The maximum is roughly four billion, not two — that is the point of the unsigned range.
  • xs:unsignedByte tops out at 255, which is the useful one for octet fields.

The schema used

This is the exact schema the literals above are validated against. Paste it into the validator with one of them to see the result yourself.

schema.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="v" type="xs:unsignedInt"/>
</xs:schema>

Open the XSD validator

Related

All 29 datatypes and facets

Get started

Bring order to the XML your team can't afford to ignore.

Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.