This paper provides a systematic welfare-based approach to analyze the impact of non-tariff measures (NTMs) on trade and welfare in the presence of market imperfections. It focuses on standard-like measures such as technical barriers and sanitary and phytosanitary regulations. The approach overcomes the shortcomings of the mainstream approach based on the analysis of foregone trade caused by trade costs. The latter ignores market imperfections, and welfare is found to increases when NTMs are reduced and trade expands. We explain how to account for external effects and market failures in trade-focused welfare analysis, leading to a more balanced overall assessment of measures despite a potential reduction of trade flows. The relationships between trade, welfare, and NTMs are complex, and generalizations are best avoided. Very often, the optimum NTM is not the absence of regulation. An application to shrimp trade illustrates the feasibility of the proposed approach. The illustration shows that the reinforcement of a food safety standard can be socially preferable to the status-quo situation, both domestically and internationally.