In set theory, Scott's trick is a method for giving a definition of equivalence classes for equivalence relations on a proper class (Jech 2003:65) by referring to levels of the cumulative hierarchy.

The method relies on the axiom of regularity but not on the axiom of choice. It can be used to define representatives for ordinal numbers in ZF, Zermelo–Fraenkel set theory without the axiom of choice (Forster 2003:182). The method was introduced by .

Beyond the problem of defining set representatives for ordinal numbers, Scott's trick can be used to obtain representatives for cardinal numbers and more generally for isomorphism types, for example, order types of linearly ordered sets (Jech 2003:65). It is credited to be indispensable (even in the presence of the axiom of choice) when taking ultrapowers of proper classes in model theory. (Kanamori 1994:47)

Application to cardinalities 
The use of Scott's trick for cardinal numbers shows how the method is typically employed. The initial definition of a cardinal number is an equivalence class of sets, where two sets are equivalent if there is a bijection between them. The difficulty is that almost every equivalence class of this relation is a proper class, and so the equivalence classes themselves cannot be directly manipulated in set theories, such as Zermelo–Fraenkel set theory, that only deal with sets. It is often desirable in the context of set theory to have sets that are representatives for the equivalence classes. These sets are then taken to "be" cardinal numbers, by definition.

In Zermelo–Fraenkel set theory with the axiom of choice, one way of assigning representatives to cardinal numbers is to associate each cardinal number with the least ordinal number of the same cardinality. These special ordinals are the ℵ numbers. But if the axiom of choice is not assumed, for some cardinal numbers it may not be possible to find such an ordinal number, and thus the cardinal numbers of those sets have no ordinal number as representatives.

Scott's trick assigns representatives differently, using the fact that for every set  there is a least rank  in the cumulative hierarchy when some set of the same cardinality as  appears. Thus one may define the representative of the cardinal number of  to be the set of all sets of rank  that have the same cardinality as . This definition assigns a representative to every cardinal number even when not every set can be well-ordered (an assumption equivalent to the axiom of choice). It can be carried out in Zermelo–Fraenkel set theory, without using the axiom of choice, but making essential use of the axiom of regularity.

Scott's trick in general 
Let  be an equivalence relation of sets. Let  be a set and  its equivalence class with respect to . If  is non-empty, we can define a set, which represents , even if  is a proper class. Namely, there exists a least ordinal , such that  is non-empty. This intersection is a set, so we can take it as the representative of . We didn't use regularity for this construction.

The axiom of regularity is equivalent to  for all sets  (see Regularity, the cumulative hierarchy and types). So in particular, if we assume the axiom of regularity, then  will be non-empty for all sets  and equivalence relations , since . To summarize: given the axiom of regularity, we can find representatives of every equivalence class, for any equivalence relation.

References 
 Thomas Forster (2003), Logic, Induction and Sets, Cambridge University Press. 
 Thomas Jech, Set Theory, 3rd millennium (revised) ed., 2003, Springer Monographs in Mathematics, Springer,   
 Akihiro Kanamori: The Higher Infinite. Large Cardinals in Set Theory from their Beginnings., Perspectives in Mathematical Logic. Springer-Verlag, Berlin,  1994. xxiv+536 pp.

Set theory