لَّيْسَ عَلَيْكُمْ جُنَاحٌ أَن تَدْخُلُوا۟ بُيُوتًا غَيْرَ مَسْكُونَةٍ فِيهَا مَتَـٰعٌ لَّكُمْ ۚ وَٱللَّهُ يَعْلَمُ مَا تُبْدُونَ وَمَا تَكْتُمُونَ
Asad Quran Translation
[On the other hand,] you will incur no sin if you [freely] enter houses not intended for living in but serving a purpose useful to you:35
but [always remember that] God knows all that you do openly, and all that you would conceal.
Lit., "uninhabited houses wherein there are things of use (mata') for you". In the consensus of all the authorities, including the Companions of the Prophet, this relates to buildings or premises of a more or less public nature, like inns, shops, administrative offices, public baths, etc., as well as to ancient ruins.
Malik Quran Translation
There is no blame on you if you enter houses which are not used for dwelling and in which you have something belonging to you; and Allah knows what you reveal and what you conceal.
Yusuf Ali Quran Translation
It is no fault on your part to enter houses not used for living in which serve some (other) use for you: and Allah has knowledge of what ye reveal and what ye conceal. 2982
The rule about dwelling-houses is strict, because privacy is precious, and essential to a refined, decent, and well-ordered life. Such a rule of course does not apply to houses used for other useful purposes, such as an inn or caravanserai, or a shop, or a warehouse. But even here, of course, implied permission from the owner is necessary as a matter of common-sense. The question in this passage is that of refined privacy, not that of rights of ownership.
Mustafa Khattab Quran Translation
There is no blame on you if you enter public places1
where there is something of benefit for you. And Allah knows what you reveal and what you conceal.
lit., non-residential buildings.
Piktal Quran Translation
(It is) no sin for you to enter uninhabited houses wherein is comfort for you. Allah knoweth what ye proclaim and what ye hide.
Laysa AAalaykum junahun an tadkhuloo buyootan ghayra maskoonatin feeha mataAAun lakum waAllahu yaAAlamu ma tubdoona wama taktumoona