Unless you are a professional sexer with many years of training, then it is not a sure thing. Even the professionals are only about 95% correct. There are many different methods of telling sex of chicks. There is vent sexing, wing sexing and color sexing that are the most popular methods. On many Large Fowl breeds it is relatively accurate to tail sex the chicks at about 4 days old. The pullets will get their tail feathers first. But this does not hold true on all breeds. Sex linked chicks can be distinguished by the color of the feathering when born. At three weeks of age, it may be very difficult to tell sex of chicks due to the extra feathering at that age.
You might want to post pictures of the chicks along with breed information and someone who raises that breed may be able to tell you what you have.