.XSD

XSD File

XML Schema Definition
Ask a question
QUICK ANSWER

An XSD file is an XML Schema Definition - a text file that sets the rules for what a particular XML document may contain. Open it in any text editor or, for syntax highlighting and validation, in Visual Studio Code with the XML extension. XSD files do not execute code and are safe to open.

Developer: W3C (World Wide Web Consortium) Category: Developer Files Open standard MIME: application/xml
OPENS ON Windows macOS Linux Web
Related: .DO · .MD · .HEX · .MAP

On this page

19k+ extensions indexed
Last reviewed Jul 12, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the XSD file format?

An .xsd file contains a formal description of XML document elements - data definitions saved in XML text format. It defines a set of rules that XML files must follow to be considered a valid XML document; a validating parser rejects any document that breaks those rules.

.xsd files do not have a unique Internet Media Type identifier - they share the same type as ordinary XML: application/xml or text/xml. Files typically begin with an XML declaration (<?xml version="1.0"?>) and a root <xs:schema> element bound to the namespace http://www.w3.org/2001/XMLSchema. XSD data can be organized into namespaces. Main schema components are:

  • Element declarations,
  • Attribute declarations,
  • Data types - simple or complex, based on restrictions, selection lists, or primitive types,
  • Reusable groups of elements or attributes (analogous to macros).

XSD specification was developed in 2001 with the help of W3C (World Wide Web Consortium). XSD offers more features than the similar .dtd document definition format, including typed data and namespace support. Web service description files such as .wsdl commonly embed XSD type definitions for their message structures. The XSD specification document is divided into three parts:

  • Part 0. Primer - contains a general description of the standard and basics, commonly consulted by less technical users working with .xsd,
  • Part 1. Structures,
  • Part 2. Datatypes.

Parts 1 and 2 are many pages long and written in technical language. A second version of the specification was released in 2004, and XSD 1.1 has been approved by W3C in 2012, adding assertions and conditional type assignment. XSD files are used for storing metadata for XML documents, but they can also be used by developers for generating code or document descriptions in human-readable form.

Security & safety

RISK: LOW

An XSD is plain text and cannot execute code, so opening one to read it is safe. The only real risks are indirect: <xs:import>/<xs:include> can pull in external schemas (XXE-style external-entity attacks target the XML PARSER, not the schema itself), so validate untrusted XML with entity expansion and external fetches disabled. The file's embedded <xs:documentation> may reveal internal field/system details, which is an information-disclosure consideration rather than a malware risk.

Format details

in a nutshell
FULL NAMEXML Schema Definition
DEVELOPERW3C (World Wide Web Consortium)since 2001 (W3C XML Schema 1.0 Recommendation); 1.1 in 2012
MIME TYPEapplication/xml
TYPEXML-based schema document (plain text, UTF-8)
STANDARDOpen · royalty-free

Programs that open XSD files

Windows5 apps
Microsoft Visual Studio Freemium Full XSD designer (graphical schema view) plus validation; xsd.exe generates classes from a schema.
Notepad Open-source Open to read/edit with XML syntax highlighting; the XML Tools plugin pretty-prints and validates.
Visual Studio Code Free Open the .xsd; with the Red Hat XML extension you get validation, autocomplete and outline.
Altova XMLSpy Paid Professional XML/XSD editor with a graphical schema design view and validation. (URL updated.)
Notepad (built-in) Built-in Quickest way to just read the text - no highlighting, but always available.
macOS2 apps
BBEdit Freemium Mac text/code editor with XML syntax coloring; the free mode opens and edits XSD fine.
Visual Studio Code Free Open and edit with the Red Hat XML extension for validation and autocomplete.
Linux2 apps
Visual Studio Code Free Open with the Red Hat XML extension for schema-aware editing and validation.
xmllint (libxml2) Open-source Validate XML against a schema: xmllint --schema schema.xsd data.xml --noout
Web1 app
FreeFormatter XSD Validator Free Paste/upload an XML and its XSD to validate one against the other in the browser.

Technical details

deep spec
File format typePlain-text XML document (UTF-8 encoded)
MIME typeapplication/xml or text/xml (shared with all XML files; no XSD-specific MIME type exists)
Root element<xs:schema> or <xsd:schema>, bound to the W3C namespace http://www.w3.org/2001/XMLSchema
File signatureNone (plain text); files conventionally open with an XML declaration <?xml version="1.0"?>
Namespace prefix conventionxs: or xsd: (both are valid; xs: is the more common modern choice)
Built-in type system44+ primitive and derived types: string, integer, decimal, dateTime, boolean, base64Binary, anyURI, and more
Type derivationComplex types support derivation by restriction or extension; simple types by restriction, list, or union
Validation constraintsContent model (sequence, choice, all), cardinality via minOccurs/maxOccurs, and facets such as pattern, length, and enumeration
Namespace supporttargetNamespace attribute declares the schema namespace; xs:import, xs:include, and xs:redefine directives combine schemas
Annotation mechanism<xs:annotation> containing <xs:documentation> for human-readable text and <xs:appinfo> for machine-readable metadata
XSD 1.1 additionsAssertions (xs:assert), conditional type assignment (xs:alternative), and relaxed co-occurrence constraints
Compared to DTDSupersedes DTD for typed, namespace-aware validation; DTD has no data types and no namespace support
Compared to RELAX NGMore widely supported in tooling than .rng; RELAX NG is simpler but lacks XSD type inheritance
Tooling integrationSupported by Visual Studio, VS Code, and Altova XMLSpy for auto-completion, real-time validation, and schema-driven code generation
Common use contextsConfiguration file validation, SOAP/WSDL web services, data interchange contracts, OOXML office document formats
Released2001 (W3C XML Schema 1.0 Recommendation); 1.1 in 2012
Open standardYes · royalty-free
Specificationwww.w3.org

XSD conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with XSD files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about XSD files.

Frequently asked questions

What is an XSD file used for?
It defines the allowed structure and data types of a kind of XML document, so software can validate XML files against it and developers know exactly what format to produce or consume.
How do I open an XSD file?
It's plain XML text - open it in any text editor. For comfortable reading use Visual Studio Code (with the XML extension), Notepad++, or a dedicated tool like XMLSpy that shows a graphical schema view.
What is the difference between XML and XSD?
XML is the data; XSD is the rulebook that says what that data is allowed to contain. An XSD is itself written in XML and is used to validate XML files.
How do I validate an XML file against an XSD?
Use a validator: xmllint --schema file.xsd data.xml on the command line, an XML editor's 'Validate' command, or an online XSD validator. It reports exactly where the XML breaks the schema's rules.
What's the difference between XSD and DTD?
Both describe XML structure, but XSD is newer, written in XML, namespace-aware and supports rich data types (numbers, dates, patterns). DTD is the older, simpler, weaker predecessor.
Can I generate code or a sample XML from an XSD?
Yes. Tools like Visual Studio (xsd.exe), Java JAXB (xjc) and XMLSpy generate classes from a schema, and most XML editors can produce a sample XML instance that conforms to the XSD.

References

1W3C - XML Schema Definition Language (XSD) 1.1 Part 1: Structureswww.w3.org
2W3C - XML Schema Part 2: Datatypeswww.w3.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.MDMarkdown Document
4.BINCD/DVD Disc Image (BIN/CUE)
5.PARTPartial Download File
6.RPMSGRestricted Permission Message
7.NOMEDIAAndroid No-Media Marker File
8.EXEWindows Executable (Portable Executable)
9.AVIFAV1 Image File Format (AVIF)
10.ICSiCalendar data file

Related extensions

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File
.NUPKGNuGet Package

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z