Datasets:
license: mit
language:
- en
- fr
size_categories:
- 10K<n<100K
A2AJ Canadian Laws
Last updated: 2026-04-26 Maintainer: Access to Algorithmic Justice (A2AJ)
Dataset Summary
The A2AJ Canadian Laws dataset provides bulk, open-access full-text legislation and regulations from Canada. Each row corresponds to a single law or regulation and contains the English and French versions where both are publicly available. The project builds on an earlier version that was maintained by the Refugee Law Lab (RLL) and is now maintained by A2AJ, a research project co-hosted by York University's Osgoode Hall Law School and Toronto Metropolitan University's Lincoln Alexander School of Law. The dataset is intended to support empirical legal research, legal-tech prototyping, and language-model pre-training in the public interest—especially work that advances access to justice for marginalised and low-income communities.
Dataset Structure (~ 10k documents)
| Code | Type | First document - Last document | Rows |
|---|---|---|---|
| LEGISLATION-FED | Federal Legislation | 1870-05-12 – 2025-06-26 | 954 |
| REGULATIONS-FED | Federal Regulations | 1945-12-21 – 2026-03-13 | 4,845 |
| LEGISLATION-ON | Ontario Legislation | 1986-07-28 – 2026-04-15 | 852 |
| REGULATIONS-ON | Ontario Regulations | 1990-12-31 – 2026-04-21 | 2,190 |
| LEGISLATION-BC | British Columbia Legislation | 1924-12-19 – 2026-03-12 | 584 |
| REGULATIONS-BC | British Columbia Regulations | 1975-04-22 – 2026-03-18 | 1,425 |
Note: Counts are approximate and will drift as the dataset is updated.
Data Fields
| Field | Type | Description |
|---|---|---|
dataset |
string |
Type identifier (eg. LEGISLATION-FED, REGULATIONS-ON) |
citation_en / citation_fr |
string |
Primary citation in English / French |
citation2_en / citation2_fr |
string |
Secondary citation(s) where available |
name_en / name_fr |
string |
Title of the law or regulation |
document_date_en / document_date_fr |
datetime64[ns, UTC] |
Date of the document |
source_url_en / source_url_fr |
string |
Source URL for the official XML version |
scraped_timestamp_en / scraped_timestamp_fr |
datetime64[ns, UTC] |
Timestamp when the page was scraped |
unofficial_text_en / unofficial_text_fr |
string |
Full unofficial text of the law/regulation |
unofficial_sections_en / unofficial_sections_fr |
string |
JSON string containing structured sections of the document |
| `upstream_license' | string |
License of the upstream source |
Missing values are represented as empty strings ("") or NaN.
Data Languages
Where available, rows include both English and French texts. Where only one language is published, the fields for the other language are empty.
Data Splits
All rows are provided in a single train split.
Data Loading
from datasets import load_dataset
import pandas as pd
# load specific type of laws (e.g. Federal Legislation)
laws = load_dataset("a2aj/canadian-laws", data_dir = "LEGISLATION-FED", split="train")
## ALTERNATIVELY
## load the entire corpus
# laws = load_dataset("a2aj/canadian-laws", split="train")
# convert to df
df = laws.to_pandas()
df.head(5)
The dataset is also offered in Parquet format for fast local use. Files are in subfolders with the dataset type names.
Dataset Creation
Curation Rationale
Building on open government initiatives, A2AJ is collecting and sharing Canadian legal data to:
- democratise access to Canadian legislation and regulations;
- enable large-scale empirical legal studies; and
- support responsible AI development for the justice sector.
Source Data & Normalisation
Laws and regulations are sourced from the Justice Canada Laws-Lois XML repository on GitHub, which contains official legislative data published by the Government of Canada. The XML files are parsed and normalised into a structured format with minimal processing (XML to plain text, cleanup, section parsing).
Personal & Sensitive Information
Legislation and regulations are public documents that do not typically include personal or sensitive information.
Non-Official Versions & Disclaimer
The texts here are unofficial copies derived from online source. For authoritative versions, consult the URLs in source_url_en / source_url_fr.
Non-Affiliation / Endorsement
A2AJ and this dataset are not affiliated with, nor endorsed by, the Government of Canada, Justice Canada or any provincial government.
Considerations for Using the Data
- Social Impact. Open legal data can reduce information asymmetries but should be used responsibly to ensure that derivative tools advance—rather than undermine—access to justice.
- Currency. Laws and regulations are living documents that change over time. This dataset represents a snapshot and may not reflect the most current versions. Always verify against official sources for legal purposes.
- Completeness. The dataset currently focuses on federal legislation and regulations.
Licensing Information
The code used to create the dataset by the A2AJ and any work on the dataset undertaken by the A2AJ is subject to an open source MIT license.
Users must also comply with upstream licenses found in the upstream_license field in the dataset for each document, which reflects the licenses through which the A2AJ obtained the document. These upstream licenses may include limits on commercial use, as well as other limitations.
The A2AJ is committed to open source methodologies, and we are actively working to obtain more permissive licenses for all data we collect.
Warranties / Representations
While we make best efforts to ensure the completeness and accuracy of our datasets, we provide no warranties regarding completeness or accuracy. The data were collected through automated processes and may contain errors. Always verify documents against the official source.
Dataset Curators
- Sean Rehaag - Co-Director, A2AJ
- Simon Wallace - Co-Director, A2AJ
- Contact: a2aj@yorku.ca
Citation
Sean Rehaag & Simon Wallace, "A2AJ Canadian Laws" (2025), online: Hugging Face Datasets https://huggingface.co/datasets/a2aj/canadian-laws.
Acknowledgements
This research output is supported in part by funding from the Law Foundation of Ontario and the Social Sciences and Humanities Research Council of Canada, by in-kind compute from the Digital Research Alliance of Canada and by administrative support from the Centre for Refugee Studies, the Refugee Law Lab, and Osgoode Hall Law School. We also thank Justice Canada for maintaining the open XML repository of federal laws and regulations.