A by-law (bye-law, by(e)law, by(e) law) is a rule or law established by an organization or community to regulate itself, as allowed or provided for by some higher authority. The higher authority, generally a legislature or some other government body, establishes the degree of control that the by-laws may exercise. By-laws may be established by entities such as a business corporation, a neighborhood association, or depending on the jurisdiction, a municipality.

In the United Kingdom and some Commonwealth countries, the local laws established by municipalities are referred to as by(e)-laws because their scope is regulated by the central governments of those nations. Accordingly, a bylaw enforcement officer is the Canadian equivalent of the American Code Enforcement Officer or Municipal Regulations Enforcement Officer. In the United States, the federal government and most state governments have no direct ability to regulate the single provisions of municipal law. As a result, terms such as code, ordinance, or regulation, if not simply law, are more common.