What is the GRAPHML file format?
A .graphml file stores graph data - networks of nodes and edges - in a standardized .xml-based format developed by an academic consortium (University of Konstanz, TU Wien, Brown University) and first published in 2001. It is widely used in network science, social network analysis, bioinformatics, and graph databases.
The structure is straightforward: a <graphml> root element (namespace http://graphml.graphdrawing.org/graphml) contains optional <key> declarations defining a typed attribute schema, followed by one or more <graph> elements. Each <graph> holds <node> and <edge> elements; both may carry <data key="..."> children to attach attribute values. Directed, undirected, mixed, hypergraph, and nested hierarchical graph structures are all supported.
GraphML is a data interchange format, not a visual diagram tool. It encodes graph topology and attributes only; visual coordinates and styling can optionally be added via extension attributes (for example, the y:Geometry attributes used by the yEd editor). The .graphmlz variant is a gzip-compressed .graphml file.
Because .graphml is uncompressed XML, any text editor can inspect it. For analysis and visualization, the most common tools are Gephi (open-source network analysis) and yEd Graph Editor. Python's networkx, Java's JGraphT, and R's igraph library all read and write .graphml natively. A related format is .gexf, used natively by Gephi.
Security & safety
RISK: LOWA .graphml file is plain XML data and cannot execute code. Opening it is safe. Very large graph files (hundreds of MB) may consume significant RAM in Gephi or yEd (multi-GB for large social networks) - memory-limit the JVM if opening large files. No scripting or macros are possible in the GraphML format.
Format details
in a nutshellPrograms that open GRAPHML files
Technical details
deep spec| File encoding | Plain XML text, UTF-8 |
| Root element | <graphml> with XML namespace http://graphml.graphdrawing.org/graphml |
| Node element | <node id="..."> - ID must be unique within the document |
| Edge element | <edge source="..." target="..."> - directed or undirected per the parent <graph edgedefault="..."> attribute |
| Attribute schema | <key> declarations define typed attributes (string, int, double, boolean, long, float) scoped to node, edge, or graph |
| Attribute values | <data key="..."> child elements attach declared attribute values to individual nodes or edges |
| Graph types supported | Directed, undirected, mixed, hypergraph, and nested/hierarchical graphs |
| Compressed variant | .graphmlz - a gzip-compressed .graphml file; the standard extension for compressed GraphML graphs |
| Binary signature | None - starts with optional <?xml declaration then <graphml |
| Typical file size | 1 KB (small test graphs) to 500 MB+ (large social or biological networks) |
| MIME type | application/xml (informally also application/graphml+xml) |
| Visual layout | Not encoded in the base spec; the yEd extension adds y:Geometry and y:NodeLabel attributes for optional layout data |
| XML schema location | http://graphml.graphdrawing.org/xmlns/1.1/graphml.xsd |
| Released | 2001 (initial GraphML specification published) |
| Latest version | GraphML 1.1 (spec stable; no significant changes since ~2007) |
| Open standard | Yes · royalty-free |
| Specification | graphml.graphdrawing.org |
GRAPHML conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about GRAPHML files.