Legal codes, for humans.
PHP CSS XSLT JavaScript Java ApacheConf Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

The State Decoded

What is The State Decoded?

The State Decoded is a free, open source, web-based application to display laws online. Although it's meant for laws, it'll basically work for any structured legal text. It makes legal text searchable, interconnected, and machine-readable, adding an API, bulk downloads, and powerful semantic analysis tools. With The State Decoded, legal codes become vastly easier to read, more useful, and more open. Here's an actual before-and-after from the Code of Virginia:

Before and After

Can I try it out?

Sure! This project can be seen in action on sites for Virginia, Chicago, San Francisco, and a growing list of others. If you want to install it, you can also download a Vagrant image from GitMachines, or just download and install it from scratch.

Is this ready for prime time?

Quite nearly! The current release is being used in production on a half-dozen different sites, with no serious bugs, and is certainly in good enough shape to be used on websites that aren't official, government-run repositories of the law. The only catch is that, until v1.0 is released (the next major release due out), there's no built-in upgrade path to new releases. That said, it's easy enough to install a new version and just re-import your site's legal code.

This is a pre-v1.0 release, which is to say that it isn't quite done. A capable developer who is comfortable with legal terminology should be able to wrangle her laws into this release with a couple of hours of work.

How do get my legal code into The State Decoded?

There are two ways.

  1. Natively, The State Decoded imports XML in The State Decoded XML format. If you have your legal code as XML, you can adapt the provided XSLT to transform it into the proper format. Or if you don't have your legal code as XML, you can convert it into XML.
  2. Skip XML entirely and modify the included parser to import it in the format in which you have it.

Project documentation

Project documentation can be found at, which explains how to install the software, configure it, customize it, use the API, and more. The documentation is stored as a GitHub project, with its content automatically published via Jekyll, so in addition to reading the documentation, you are welcome to make improvements to it!

How to help

  • Use State Decoded sites and share your feedback in the form of filing issues—suggestions for new features, notifications of bugs, etc.
  • Write or edit documentation on the wiki.
  • Read through unresolved issues and comment on those on which you have something to add, to help resolve them.
  • Contribute code to fix bugs or add features.
  • Comb through existing code to clean it up—standardizing code formatting, adding docblocks, or editing/adding comments.

Keep up to date

Follow along on Twitter @StateDecoded, or on the project website at

Supported by

Development of The State Decoded was funded by the John S. and James L. Knight Foundation’s News Challenge.