A standard can be defined as a test method, definition, or recommended practice regarding manufacturing, testing, dimensions, and/or certification of raw materials and finished goods. The intent in creating a standard is to produce goods that are safe and reliable. Standards are usually created by organizations that are purposed for that activity. The terms standard, specification, and code are often used interchangeably. Voluntary or mandatory compliance is the distinguishing feature. Standards and codes are subject to mandatory compliance when such standards and codes are referenced to in regulations such as the Code of Federal Regulations or in municipal building codes. Legal liability is a result of such referencing. The same codes and standards are enforceable via inspection. Construction, manufacturing, food service and other operators are subject to fines when they fail said inspections. When a legal suit is brought forth, the outcome hinges on the extent of compliance to the respective standard, code, or specification. The intent of this regulation is safer products, processes and work environments.
“Code" is a term of much broader meaning than either specification or standard and can best be described as a set of rules established by a recognized authority examples such as the US federal government's Code of Federal Regulations (CFR), and the American Society of Mechanical Engineers' (ASME), Boiler and Pressure Vessel Code. In adopting the rules that make up the various codes, consideration is generally based on health, safety, and environmental protection. The code-formulating bodies, in addition to writing their rules, usually adopt standards and specifications either in whole or in part to become a part of the code. Industries must follow the codes that are adopted by the respective jurisdiction. For example, a city (a type of jurisdiction) may decide to adopt the National Electical Code which then establishes the rules by which electrical contractors must adhere. Inspection of construction work is driven by the NEC for those jurisdictions.
Specification. Avoid splitting hairs with over these definitions. A specification is a form of standard, which precisely states a set of requirements to be satisfied. These requirements might be chemical composition, mechanical properties, or any other requirement that is necessary to develop the quality and reliability of an end product. . Specifications are also referred to as "specs". Specifications are often thought of functionally, as follows. Specifications capture the essence, or "gist", ie the minimal thresholds of the standard or code in which they lie. Wherever you see in the text (of a standard or code) a list of instructions, the same list of which indicates the order of progression of a series of steps that must be followed with precision, you are looking at the "spec". There may be more than one spec within the standard or code, depending on the complexity of the topic.
 Adapted from the Steel Founders of America http://www.sfsa.org/sfsa/buyrord3.php