If you select "Highlight Moves" in the settings, then just clicking on the king will show you if it can castle or not.
How to know if castling is allowed in puzzles?
But that works only if the king can castle in the current position. I would like to know if I still have the castling rights (e.g. the king hasn't moved previously or one of the rooks). This piece of information is required to know if the king can castle in a future position.

Most if not all the time, puzzles are designed in a way that if the king and rook are on their starting squares, then it is taken for granted that they still have castling rights, and they didn't move away from the square then back onto the square.

Most if not all the time, puzzles are designed in a way that if the king and rook are on their starting squares, then it is taken for granted that they still have castling rights, and they didn't move away from the square then back onto the square.
Yeah, and these days websites generate puzzles by mining them from games played on the site... and since the positions came from games then you can be sure that, for example, a king on e1 hasn't moved yet.
If it can be taken for granted that the king and rooks haven't moved, there is no problem then. I just wanted to know if this is indeed the case.
It was exactly the fact that the puzzles are often automatically generated from games that made me worry about the castling rights. It is totally possible for example that a king has moved from its starting square ang then moved back later. So in that case, the puzzle generation algorithm should discard those positions (or modify their castling right, but then its not the position from the game anymore, although that doesn't matter either). That should be easy to do at least. But I couldn't find this written down anywhere.

Well just try to castle.....the puzzle will either allow it, or it won't.
This method has a hidden weakness if castling is not the solution.
Actually you'll need to know where the puzzle comes from. Many puzzles here come from game positions but also many come from composed problems. In composed problems you can always and only castle if a history exists that leads up to the diagram in which you can still castle. That convention takes precedence over what the puzzle allows you to do. If it allows you to castle but no history exists to support the right to castle then castling is illegal! That works in both directions.
Anyone posting puzzles from games would do wise to follow the convention for composed problems as it is safe. If the castling right is different from what you expect from the diagram just give the castling information in a comment with the puzzle!
I would prefer to have the information about the castling rights shown somewhere along with the position. It is in reasonable to expect anybody to know where the puzzle comes from.
Just to clarify the issue, here is an example puzzle, which I got right by assuming Black can castle, but if it weren't allowed, the puzzle wouldn't have a clear solution:
https://www.chess.com/puzzles/problem/1218473
I would prefer to have the information about the castling rights shown somewhere along with the position. It is unreasonable to expect anybody to know where the puzzle comes from.
Chess.com is at fault here. It is simple to add a checkbox to a puzzle where you can specify whether or not a puzzle comes from the "professional" composition domain and follows its conventions. That would remove a lot of confusion around these recurring issues.
I wish you luck. Currently the puzzle interface is in the worst condition since 2015 when I joined. The designer team which made many changes in the past months has a motto: 1 step forward, 2 steps back.
https://www.chess.com/puzzles/problem/1339383
That explains why this pile of crap puzzle only has a 29% pass rate ... I was part of the 71%
https://www.chess.com/puzzles/problem/1339383
That explains why this pile of crap puzzle only has a 29% pass rate ... I was part of the 71%
Not really. Most solvers will assume castling right and they get it here. What makes this puzzle difficult is that it does not offer typical tactical devices, just some regular skin saving moves. When I see the solution I wonder: "Where is the puzzle?"
Most if not all the time, puzzles are designed in a way that if the king and rook are on their starting squares, then it is taken for granted that they still have castling rights, and they didn't move away from the square then back onto the square.
This is my understanding too. If a king and a rook are on their starting squares and if nothing prevents them from castling (rook or king having moved previously, pieces in the way of castling, checks, enemy pieces controlling squares required for castling), it is assumed the player can castle by default.
If the puzzle maker doesn't want to allow the player to castle in a position where a player should be able to castle normally if no information is given about the previous moves, he or she must specify it.
If the puzzle maker doesn't want to allow the player to castle in a position where a player should be able to castle normally if no information is given about the previous moves, he or she must specify it.
The problem is you can't trust chess.com in this (as in many other departments). The puzzles are (almost?) always harvested from real games. Whatever is true about actual castling rights in those games will not be conveyed to the puzzle solvers in any way. I assume the castling rights are simply copied from the game as solutions may depend on them. Which gives us no relief at all since we have no access to game records or FEN settings for those puzzles.

I have also faced this exact problem of not knowing whether castling is allowed or not. In particular, I most commonly face the problem when I don't know if the opponent can or cannot castle. For a long time the default setting was not having castling rights, or at least that seemed to be the case by my experience. However, during recent years I have discovered more and more puzzles where castling is allowed, which I find incredible annoying, as I had been used to always assume that castling where not allowed.
But yes, I definitely think that there should a way to find out your and your opponent's castling rights. I think it is pretty remarkable that after 13 years of using this site, this problem still remains unresolved.
But yes, I definitely think that there should a way to find out your and your opponent's castling rights. I think it is pretty remarkable that after 13 years of using this site, this problem still remains unresolved.
It is only resolvable with care. Whatever the system, whatever the agreements, someone will need to implement them when preparing the puzzle posts.
Note that the field of composition has resolved this issue (at least the common cases) but the field of "puzzles" has not simply because it lacks an authoritative body to make these decisions. There is no WFPM - world federation of puzzle makers. Today chess.com may decide one thing and tomorrow lichess does another. And on the 3rd day the complaints start arriving from both communities as many members visit both.
Btw, I know how it can be done seamlessly but it takes some writing and nobody listens anyway.
Is there are way to know if castling is allowed in a puzzle position? It could affect the solution.