A court clerk (British English clerk to the court, /kl?:k/; American English clerk of the court or clerk of court, /kl?k/) is an officer of the court whose responsibilities include maintaining records of a court. Another duty is to administer oaths to witnesses, jurors, and grand jurors.
In the magistrates' courts of England and Wales, where the bench will usually have no legal qualifications, the court clerk will be legally qualified. The magistrates decide on the facts at issue; the clerk advises them on the law relating to the case.
Clerks of court can be found at every level of the Courts of Scotland, with a legally qualified clerk acting as legal adviser to justices of the peace in justice of the peace courts. In the sheriff courts the clerk is known as a sheriff clerk, and the sheriff clerks are responsible for the administration and running of all cases in the court. Clerks also support and administer the Court of Session and High Court of Justiciary, with the Principal Clerk of Session and Justiciary responsible for the administration of the Supreme Courts of Scotland and for directing their associated staff.
Federal courts, including the Supreme Court of the United States, the United States courts of appeals, the various United States district courts (and their attached bankruptcy courts) and other Article III courts all employ a "clerk of court" who is the executive hired by the judges of the court to carry out the administration of the court. Among the clerk's core duties are the maintenance of exhibits of the court, the custody and administration of the funds received by and dispensed from the court, the oversight of non-judicial personnel, and the provision of services to the judges of the court. A court reporter maintains the record of the court's proceedings. 
Historically, some state trial courts have traditionally used the county clerk as the ex officio court clerk as a money-saving measure. Other states achieved the same result by making the court clerk the ex officio county clerk, as well as other roles such as county recorder, auditor, etc.
This double consolidation of roles between the executive and judicial branches and between state and local governments made sense as a money-saving measure in sleepy rural counties on the American frontier when they were sparsely populated and had rather rudimentary legal systems. It no longer made quite as much sense in heavily populated urban counties by the late 20th century. Attempts by state trial courts to employ their own court clerks independent of county clerks were upheld by the Supreme Court of California in 1989 and the Supreme Court of Nevada in 2001.
A legal adviser in the court gives advice on the law and makes sure the magistrates follow the right procedures.
Day-to-day responsibility for judicial administration rests with each individual court.