The formula of a square is based on what exactly you are trying to calculate.
For calculating area, the formula is: A=a^2
For calculating perimeter, the formula is: P=4a
For calculating the polygon diagonals, the formula is: q = √(2a^2) = a√2
For calculating the side of a square, the formula is: a = √A, a = P/4, a = q/√2
If there is any context missing from your question, please add it so I can give you a precise answer.