Revelation 21:27

27 Nothing impure will ever enter it, nor will anyone who does what is shameful or deceitful, but only those whose names are written in the Lamb’s book of life.

Read Revelation 21:27 Using Other Translations

And there shall in no wise enter into it any thing that defileth, neither whatsoever worketh abomination, or maketh a lie: but they which are written in the Lamb's book of life.
But nothing unclean will ever enter it, nor anyone who does what is detestable or false, but only those who are written in the Lamb's book of life.
Nothing evil will be allowed to enter, nor anyone who practices shameful idolatry and dishonesty—but only those whose names are written in the Lamb’s Book of Life.

What does Revelation 21:27 mean?

John Gill's Exposition of the Bible
Revelation 21:27

And there shall in no wise enter into it anything that
defileth
As evil thoughts, words, and actions do; and therefore he that enters into this city must be free from all these: or "that is defiled", as the Vulgate Latin and Syriac versions read; or "that is unclean", as the Arabic and Ethiopic versions; alluding to the tabernacle and temple, into which no unclean person might come; see ( Isaiah 52:1 ) . No profane sinner, whose mind and conscience are defiled, and whose conversation is defiling, may enter here; nor any self-righteous person, whose righteousness is as filthy rags, and he himself is as an unclean thing, shall be admitted here; only such who are washed in the blood of Christ, and have on his righteousness, and so are without spot or wrinkle; which shows the pure and perfect state of this church and therefore cannot design any state of the church previous to the coming of Christ and the first resurrection:

neither whatsoever worketh abomination;
commits sin, which is abominable in the sight of God, lives and dies in a course of wickedness; or particularly is guilty of idolatry, either makes idols, or serves them, or both, which are an abomination to the Lord; see ( 1 Kings 11:7 )

or maketh a lie;
any lie in general; who is a common liar, loves and invents a lie, and speaks one; delivers that which is false with an intention to deceive; or in particular, who embraces and propagates antichristian lies, doctrinal ones, lies spoken in hypocrisy; such shall be damned; see ( 1 Timothy 4:1 ) ( 2 Thessalonians 2:11 2 Thessalonians 2:12 ) but they which are written in the Lamb's book of life; who are predestinated to eternal life; and though they are naturally, and in themselves defiled and sinful creatures, yet they are justified by the righteousness of Christ, and sanctified by his Spirit, and so are made meet and fit to enter this city; (See Gill on Revelation 13:8). It is by the Jews observed F4, that

``the Jerusalem of the world to come is not as the Jerusalem of this world; the Jerusalem of this world, whoever would go up to it (or enter into it) might; but that of the world to come, (hl Nynmwzmh ala Nylwe Nya) , "none may go up to it (or enter into it) but those who are prepared", or appointed for it.''


FOOTNOTES:

F4 T. Bab. Bava Bathra, fol. 75. 2.
California - Do Not Sell My Personal Information  California - CCPA Notice