James names the "royal law" as: "You shall love your neighbor as yourself" (James 2:8). He uses it as a standard that exposes the wrong of partiality.
James 2:8–13 says the community’s treatment of people is measured against a single, Scripture-grounded command: love your neighbor as yourself (James 2:8). Showing favoritism is not a small flaw but a real breach of God’s instruction. James argues that breaking any part of the law makes someone a lawbreaker, illustrated by two well-known commands. This paragraph continues James’s rebuke of favoritism toward the rich and dishonor toward the poor (2:1–7). He now grounds the critique in Scripture and in the inner coherence of God’s commands: neighbor-love is the “royal law,” and partiality violates it.
James treats neighbor-love as the key measuring rule for how the community relates to people (verse 8). He calls it the “royal law” and anchors it in Scripture’s command, “love your neighbor as yourself.” In the flow of the argument, favoritism is not a minor social mistake; it is named as sin and exposed as law-breaking (verse 9).
A careful answer keeps the immediate passage, the book's argument, and the whole-Bible storyline together, so the question is answered in context instead of as a detached idea.
Start with James 2:8, then read the surrounding section so the answer stays connected to the passage's flow.
8However, if you fulfill the royal law, according to the Scripture, "You shall love your neighbor as yourself," you do well.